How do I use the cin >> function with the if statement?
//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