I dunno wut i did wrong at the end of this program

#include<iostream>
using namespace std;
int main()
{
int a;
char b;
string c;

cout << "Hey wanna play a game? (y/n)" << endl;
getline(cin, c);

if( c == "y" || c == "Y")
{
cout << "Sweet ok." << endl;
}
else
{
cout << "Too bad" << endl;
cin.get();
return 0;
}

cout << "Pick a number between 1-4" << endl;
cin >> a;


switch(a)
{

case 1: cout << "Hmmm...you gonna die tommorow\n";
break;

case 2: cout << "Uhh\n";
break;

case 3: cout << "tuhig\n";
break;

case 4: cout <<"rgjrg\n";
break;

default: cout << "FAIL\n";
break;

}
{
cout << "Wanna try again? (y/n)" << endl;
cin >> b;
}while(b == 'y' || b == 'Y');
}


The while part, I thought it will loop back to the beginning but instead after you press "y", it just..stop there.
Im missing something, does anyone know what it is? And also how do you make a program that clears everything and start again by looping if u know wut i mean.
I remember it's something like system("CLS") or something.
a do-while construct looks like this :
1
2
3
do {
     //some stuff
} while (condition);
What do you mean?

#include<iostream>
using namespace std;
int main()
{
int a;
char b;
string c;

do { // There, I put a do there
cout << "Hey wanna play a game? (y/n)" << endl;
getline(cin, c);

if( c == "y" || c == "Y")
{
cout << "Sweet ok." << endl;
}
else
{
cout << "Too bad" << endl;
cin.get();
return 0;
}

cout << "Pick a number between 1-4" << endl;
cin >> a;


switch(a)
{

case 1: cout << "Hmmm...you gonna die tommorow\n";
break;

case 2: cout << "Uhh\n";
break;

case 3: cout << "tuhig\n";
break;

case 4: cout <<"rgjrg\n";
break;

default: cout << "FAIL\n";
break;

}
{
cout << "Wanna try again? (y/n)" << endl;
cin >> b;
}while(b == 'y' || b == 'Y');
}

Ok so the do is there, I need to do something at the end to fix it, how?
nvm I get it
Topic archived. No new replies allowed.