C++ program trouble Immediate HELP SOS !!!
Go to solution
Solved by Hunter259,
Just now, Runelight said:what do u mean so how should i do with a single read in variable ??? Im new to C++ thats why
You are asking A or B you only need one variable to do that.
int A = 0;
cout<<"Enter 1 for Blah, 2 for Yay.\n";
cin>>A;
if(A==1){
cout<<"Blah.\n";
}
else cout<<"Yay.\n";
OR
cout<<(A==1 ? "Blah.\n" : "Yay.\n");
-
Featured Topics
-
Topics
-
xJDL ·
Posted in Troubleshooting0 -
Marie Rose ·
Posted in Power Supplies8 -
7
-
4
-
6
-
13
-
10
-
Tamgam12 ·
Posted in New Builds and Planning6 -
remo233 ·
Posted in New Builds and Planning25 -
5
-
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now