Advertisement
/* C++ nested if statement*/
#include<iostream>
using namespace std;
int main()
{
if(99<100)
{
if(99>98) // This is a nested if statement
cout<<"99 is less than 100 & 99 is greater than 98";
}
else
cout<<"99 is not less than 100";
return 0;
}
99 is less than 100 & 99 is greater than 98
Advertisement
/* C++ nested if statement*/
#include
using namespace std;
int main()
{
if('c'>'a')
{
// A nested if statement
if('c'>'b')
cout<<"c is greater than b and c is greater than a";
}
else
cout<<"b is not less than a";
return 0;
}
c is greater than b and c is greater than a
Advertisement
Advertisement
Please check our latest addition
C#, PYTHON and DJANGO
Advertisement