Advertisement



< Prev
Next >



C++ Else If Statement




In C++ language, the else-if statement consists of three parts -







Working of else-if


First the condition in the parenthesis of if is evaluated for a boolean value - true or false.




Advertisement




else if statement example


/* C++ else if statement example */

#include<iostream>

using namespace std;
int main()
{
if(99>100)
	cout<<"9 is greater than 10";
else if(99<90)
	cout<<"9 is less than 9";
	else
		cout<<"9 is greater than 8 and less than 10";
		
return 0;
}


Output


9 is greater than 8 and less than 10




Please share this article -





< Prev
Next >
< If Else Statement
Nested If Statement>



Advertisement

Please Subscribe

Please subscribe to our social media channels for daily updates.


Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page




Advertisement

Notifications



Please check our latest addition

PYTHON


Advertisement