Question: I need to write a program in C++ where the user can do some computation, and when the computation is done, the program will ask the user if he wants to do another computation. I know how to write this in Python:

```
more = "y"
while (more == "y"):
    // computation code
    print "Do you want to do another computation? y/n "
    more = input()

```

I created a char variable and used it in the head of the loop, but I don't know how to implement the "input" function in C++. I tried using the cin.get(char\_variable) function but the program seems to skip it entirely.

Answer: 
You can use `cin >> char_variable;` to get the value.  

Don't forget:

```
#include <iostream>
using namespace std;

```
I wrote it this way. I used `cin` for get `char` value from user.

```
#include <iostream>
using namespace std ;
int main ()
{
    char more;
    cout<<"Do you want to do another computation? y/n ";
    cin>>more;
    while(more=='y'){
        cout<<"Do you want to do another computation? y/n ";
        cin>>more;
    }
}

```