Skip to main content
To Get All Information of Sarkari Jobs | Results | Admit Card | And courses ,Internships then CLICK HERE

Nested if-:


Nested of 'if ' means one ' if ' is enclosed with in another ' if '. In nested if, every ' if ' have an else statement. 
Syntax-:
if(condition)
  if(condition)
  statement-1;
  else
  statement-2;
else
statement-3;
}
ads

Example-:
#include<stdio.h>
#include<conio.h>
main()
{ int a=0,b=0,c=0;
   printf("Enter the value of a,b,c);
   scanf("%d %d %d",&a,&b,&c);
   if(a>b)
     {if(a>c)
     printf("\n %d is largest",a);
     else
     printf("\n %d is largest",c);
     }
else if(b>c)
 printf("\n %d is largest",b);
else
printf("\n %d is largest",c);
getch();
}
output-: Enter the value of a,b,c 10
               15
               22
               22 is largest
ads Watch The Video Below


Comments

  1. subscribe tech programiz to get notification of latest blogs

    ReplyDelete

Post a Comment

Please do not enter any spam link in the comment box.


Download The Book "Let Us C" By Yashavant P.Kanetkar,Click The Below Button

-->Email Subscription

Enter Your Email Address:-

Delivered by FeedBurner

Copyright © 2020 TechProgramiz|All Right Reserved|Made By-: Sudarshan Pandey