2
Contributors
1
Reply
13
Views
4 Years
Discussion Span
Last Post by Vikram Sehgal
0

if and else statements are conditional statements
... a basic programme is

int x
cout<<" enter your number";
cin>>x;

if (x < 20){
cout<<" YAY";
}

else if (x = 30){
cout<<"HOHOHHO";
}

else {
cout<<"QUACK!!";
}

its a basic code

main:-

if:- if the condition is true it will do what u want..

else:- if the condition of if statement is false

Edited by Vikram Sehgal: spelling

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.