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

Next Update

Loading...

We create a new YouTube channel (NightHawk) for gaming purpose like online games streaming or games review.

We need some time for make video tutorials (CodeX) so, stay with us and keep supporting and you know already we make a Collaboration with HackIsOn YouTube channel long time ago So, please Subscribe Our Channels

Protection died IPs active, this IP range is not allowed !