Nested If Statement In C Programming

Nested If Statement In C Programming In Hindi ,

Nested If Statement In C Programming

Note –

  1. “Nested If Statement In C” , Video को हमारे YouTube channel  में देखने के लिए इस Link में Click करें  ।   YouTube channel link –  (Padhai Ki Batein /  पढाई की बातें)
  2. तीन और चार Numbers में Largest Value निकालने के लिए If Else Statement in C में Click करें।

C या C++ Programming में If Else Statement बहुत अधिक Important होता हैं और कई बार कुछ Programs में एक If Statement के अंदर दूसरा If Statement और दूसरे के अंदर तीसरा और इस तरह कई और If Statement Define करने की आवश्यकता पड जाती हैं । ऐसे Programs में Nested If Statement का Use किया जाता हैं।  

क्या हैं Nested If 

जब किसी Program में एक If Statement के अंदर दूसरे If Statement और दूसरे If Statement के अंदर तीसरे If Statement और इसके आगे भी Programs में जितनी जरूरत हो उतने If Statement को Use  करना , Nested If कहलाता हैं। 

Syntex –

If (Condition)

{

if (Condition)

{

 if (Condition)

Statement 1 ;

 else

 Statement 2 ;

  }

Else

                     if (Condition)

 Statement 1 ;

   else

Statement 2 ;

}

else

 if (Condition)

{

if (Condition)

 Statement 1 ;

   else

Statement 2 ;

}

else

if (Condition)

 Statement 1 ;

   else

Statement 2 ;

}

Nested If Else Statement को आप नीचे दिये गये Example से आराम से समझ सकते हैं।तीन और चार Numbers में Largest Value निकालने के लिए If Else Statement in C में Click करें।

Find Out the Largest Value of any given Five Numbers.

Nested If Statement In C Programming In Hindi

#include<iostream.h>

#include<conio.h>

void main()

{

int a , b , c , d ,e ;

clrscr() ;

cout <<“Enter Any Five Numbers    ” ;

cin>>a >>b>>c>>d>>e ;

If (a>b)

{

If (a>c)

{

if(a>d)

{

if(a>e)

cout <<“The Largest Value is A ” ;

else

cout <<“The Largest Value is  E “ ;

}

else  if(d>e) 

cout <<“The Largest Value is D” ;

else

cout <<“The Largest Value is  E“ ;

}

Else if(c>d)

{

if(c>e)

cout <<“The Largest Value is C “ ;

else

cout <<“The Largest Value is  E “ ;

}

Else if(d>e)

cout <<“The Largest Value is D” ;

else

cout <<“The Largest Value is  E“ ;

}

else

{

If (b>c)

{

if(b>d)

{

if(b>e)

cout <<“The Largest Value is B “ ;

else

cout <<“The Largest Value is  E “ ;

}

Else  if(d>e)

cout <<“The Largest Value is D” ;

else

cout <<“The Largest Value is  E“ ;

else if(c>d)

{

if(c>e)

cout <<“The Largest Value is C “ ;

else

cout <<“The Largest Value is  E “ ;

}

else

if(d>e)

cout <<“The Largest Value is D” ;

else

cout <<“The Largest Value is  E“ ;

}

getch() ;

तीन और चार Numbers में Largest Value निकालने के लिए If Else Statement in C में Click करें।

If Else Statement In C Programming In Hindi ,

“Nested If Statement In C” , Video को हमारे YouTube channel  में देखने के लिए इस Link में Click करें  ।   YouTube channel link –  (Padhai Ki Batein /  पढाई की बातें)

NOTE – Class 8th , 9th , 10th , 11th , 12th के हिन्दी विषय के सभी Chapters से संबंधित videos हमारे YouTube channel (Padhai Ki Batein /  पढाई की बातें) पर भी उपलब्ध हैं। कृपया एक बार अवश्य हमारे YouTube channel पर visit करें । सहयोग के लिए आपका बहुत – बहुत धन्यबाद।

You are most welcome to share your comments . If you like this post . Then please share it . Thanks for Reading.

यह भी पढ़ें

C और C++ क्या हैं ?

C या C++ में पहला Program कैसे बनाते हैं ?

Difference Between If And If Else Statement In C

6 Small And Simple Programs For Beginners

If And If Else Statement in C

If Else Statement in C

Find Out the Largest Value of any given four And Three Numbers in C

Nested If Statement

What is HTML Coding

Web Page कैसे बनाते हैं

HTML Form 

How To Create Table In Html

How To Create Hyperlink In HTML

How To Insert An Image In HTML Page

Ordered And Unordered List In HTML

Frame In HTML Coding

Add Background Color And Image

Map in HTML

Nested List In HTML

How To Create A Website Using HTML Only On Notepad No CSS Used

How TO Create A Beautiful And Simple WebPage Using HTML Only (No CSS Used)