Ask coding questions

← Back to all posts
Won't print what i'm wanting it to
KASON123

C++

#include <iostream>

int main() {
using namespace std;
int Y;
int N;

//Where user inputs yes or no
cout << "Do you wish to play the game Y or N" << endl;
if(Y){
cin >> Y;
cout << "OK" << endl;
}
else if(N) {
cin >> N;
cout << " Oh ok" << endl;
}
if(Y){
cin >> Y;
cout << "Ok lets start" << endl; <<<<< Here

}
}

it works,but im trying to get the user to put Y in the output, and then it says Ok lets start

Answered by samfierycreeper [earned 5 cycles]
View Answer
Voters
KASON123
Comments
hotnewtop
samfierycreeper

@KASON123 You could do something like this: