< Prev
Next >

Nested if-else Statement

In nested if-else decision making statement of C language, an if-else statement is nested inside an outer if statement, hence it is named nested if-else.

Working of nested if-else

  • If the condition of outer if statement is false then the statement connected to its else part is executed and nested if-else is not executed.

  • The statement connected to the if of the nested if-else is only executed when -: If condition of this nested if is false then the statement with its connected else is executed.

    Nested if-else example

    /* nested if-else example */
    int main()
    	 	printf("99 is less than 100 & 99 is also less than 101");
    		printf("99 is less than 100 but 99 is not less than 98");
    	printf("99 is not less than 100");
    return 0;


    99 is less than 100 & 99 is also less than 101

    Please share this article -

    Facebook Google Pinterest Reddit Tumblr Twitter

    < Prev
    Next >
    < Nested If Statement
    For Loop>

    Please Subscribe

    Please subscribe to our social media channels for daily updates.

    Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page


    Please check our latest addition