Write a Program of Decision making statements using If and Else
IF Else Statement is conditional statements, work if Condition is true If Part Statement Code is Working Else Part not Work.
if Condition is False,Else Part Statement Code is Working.
if(condition){
Statement
}else{
Statement
}
Program
//Write a Program of Decision making statements using If and Else #include<iostream.h> #include<conio.h> void main(){ clrscr(); int number=0; cout<<" If-Else Program "; cout<<"\n -----------------"; cout<<"\n Enter Number 0-10 : "; cin>>number; if(number>10){ cout<<"\n Number is Greater Than 10 "; }else{ cout<<"\n Number is Between 0-10 "; } getch(); }
Output / Result
(Visited 118 times, 1 visits today)