< Prev
Next >

Nested if Statement

In C++, the nested-if is another decision making statement in which an if statement is nested inside an outer if statement, hence it is named nested if.

The statement connected to the nested if statement is only executed when -:

nested if example

/* C++ nested if statement*/


using namespace std;
int main()
	if(99>98)  // This is a nested if  statement
	cout<<"99 is less than 100 & 99 is greater than 98";

	cout<<"99 is not less than 100";
return 0;


99 is less than 100 & 99 is greater than 98

Please share this article -

Facebook Google Pinterest Reddit Tumblr Twitter

< Prev
Next >
< Else-If Statement
Nested If-Else Statement>
Please subscribe our social media channels for notifications, we post a new article everyday.

Decodejava Google+ Page Decodejava Facebook Page  DecodeJava Twitter Page

Coming Next