
Syntax:
if (condition)
{
Statements;
.
.
if(condition)
{
statements;
.
.
}
else
{
statements;
.
.
}
.
.
}
else
{
Statements;
.
.
}
/*—————————————————————-*/
#include<iostream.h>
#include<conio.h>
void main()
{
char desig = ‘s’;
int sal=10000;
if(desig==’s')
if(sal>=5000)
cout<<”Eligible for bonud”;
else
cout<<”Not eligible for bonus”;
else
cout<<”Invalid Designation”;
getch();
}
/*—————————————————————————-*/
Output:
Eligible for bonus
See also: Swith….Case Statements in C++
Not Satisfied ? Just search & get the result
Related posts:
