Nested if else in c | Nested if else statement in c example in Hindi

Nested if else in c :- Nested If else Statement Ko samajh ne ke liye ham is post me C programming nested if else ke example ko Dekhte hai or Fir iske kuch nested in c program banate hai. C If else statement If condition in hindi

Nested if else in c

C Programming Full Course| Full Course C programming in Hindi

C nested if else condition ke under ek or if else condition jo hoti hai. usse hi ham nested if else c kahte hai.

C nested If else Statement ka ham pahle syntax Dekhte hai .

Syntax of Nested if else statement:

If else condition ke under ek or if else condition hoti hai. usse hi ham nested c if else kahte hai.

if(condition) {
    //Nested if else inside the body of "if"
    if(condition2) {
       //Statements inside the body of nested "if"
    }
    else {
       //Statements inside the body of nested "else"
    }
}
else {
    //Statements inside the body of "else"
}

C Nested If Else statement syntax me expression ko check kar rhe hai or uske bad us statement ke under ek or condition check kar rhe hai and uske bad ham statement ko print kar rhe hai.

Nested If Else Statement in c Flow Chart

Nested in c Flow Chart
c programming Nested if else statement

Nested Else If Statement ko acchi tarah se samajh ne ke liye ham ab ek program banate hai. and usme ek condition lga ke us program ko run karte hai.

Example of nested if..else

#include <stdio.h>
#include <conio.h>
int main()
{
   int var1, var2;
   printf("Input the value of var1:");
   scanf("%d", &var1);
   printf("Input the value of var2:");
   scanf("%d",&var2);
   if (var1 != var2)
   {
 printf("var1 is not equal to var2\n");
 //Nested if else
 if (var1 > var2)
 {
  printf("var1 is greater than var2\n");
 }
 else
 {
  printf("var2 is greater than var1\n");
 }
   }
   else
   {
 printf("var1 is equal to var2\n");
   }
   return 0;
}

Output :-

Input the value of var1:12
Input the value of var2:21
var1 is not equal to var2
var2 is greater than var1
Nested If Else Statement kese work karta hai ?

C Nested if else statement kese work karta hai ham is photo ki image se understand karte hai.


Nested If Else Statement kese work karta hai ?
Nested if else statement with example
Program Nested if else :- Write A Program to find largest of three number ?
#include<stdio.h>
#include<conio.h>

void main()
{
    int a,b,c;
    printf("Enter The Three Number :");
    scanf("%d %d %d",&a,&b,&c);

    if(a>b)
     {  
        if(a>c)
             {
                   printf("Greater Number %d",a);
              }
        else
              {
                   printf("Greater Number %d",c);
               }
       }
    else
     {
             if(b>c)
              {
                 printf("Greater Number %d",b);
              }
              else
               {
                  printf("Greater Number %d",c);
                }
      }
   getch();
}
                 

Output :-

Enter The Three Number : 10 20 30
Greater Number 30

if statement in c | How To Use if Statement With Example in C

Nested if else statement in c example in Hindi

Dosto mujhe ummed hai ki aap Nested if else statement in c example in Hindi ko acchi tarah se samanj gye honge agar aap ko ye post acchi lage to mere is website ko jarur follow kre or ha agar aap video bhi dekhna chahte hai to aap mere channel ko bhi subscribe kar sakte hai. channel ka link aapko home page par mil jayega |

Danish Ali

I Am a Cyber Security Student & I have Skills C, C++ ,Python, HTML,CSS, Computer & Advance Hacking & Blogger & YouTuber.

View Comments

  • Hi! Do you know if they make any plugins to protect against hackers? I'm kinda paranoid about losing everything I've worked hard on. Any recommendations?

Share
Published by
Danish Ali

This Website Uses Cookies in order to offer you the most relevant information.Please accept cookies for optimal performance