C Nested if-else Statement :

Nested if-else :

An if statement may have another if statement in the <true block> and <false block>, this compound statement is called nested if statement.

Example :

  1. /* Description: program to find biggest of three numbers use nested if-else */
  2. #include<stdio.h>
  3. main()
  4. {
  5. int a,b,c,big;
  6. printf("\n Enter three numbers:\n");
  7. scanf("%d%d%d",&a,&b,&c);
  8. if(a>b)
  9. if(a>c)
  10. big=a;
  11. else
  12. big=c;
  13. else
  14. if(b>c)
  15. big=b;
  16. else
  17. big=c;
  18. printf("\n Biggest number is: %d",big);
  19. getch();
  20. }

Output :

c language - program to find biggest of three numbers use nested if-else

Computer Science Engineering

Special Notes

It's a special area where you can find special questions and answers for CSE students or IT professionals. Also, In this section, we try to explain a topic in a very deep way.

CSE Notes