Dec 11, 2010 at 6:36pm
How do I use the cin >> function with the if statement?
Dec 12, 2010 at 12:57am
//this is for single if statement
cin >> variable;
if (condition base on the input variable)
//the code to be executed if the condition is met
statement;
//for the multi if statement
cin>>variable;
if (condition base on the input variable)
{
//codes that are to be executed if the condition is met
statement 1;
statement 2;
statement 3;
statement 4;
}
Last edited on Dec 12, 2010 at 12:59am