Nested If Statement In C Programming

Nested If Statement In C Programming :

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.

यह भी पढ़ें

  1. C और C++ क्या हैं ?
  2. C या C++ में पहला Program कैसे बनाते हैं ?
  3. Difference Between If And If Else Statement In C
  4. 6 Small And Simple Programs For Beginners
  5. If And If Else Statement in C
  6. If Else Statement in C
  7. Find Out the Largest Value of any given four And Three Numbers in C
  8. Nested If Statement
  9. What is HTML Coding
  10. Web Page कैसे बनाते हैं
  11. HTML Form 
  12. How To Create Table In Html
  13. How To Create Hyperlink In HTML
  14. How To Insert An Image In HTML Page
  15. Ordered And Unordered List In HTML
  16. Frame In HTML Coding
  17. Add Background Color And Image
  18. Map in HTML
  19. Nested List In HTML
  20. How To Create A Website Using HTML Only On Notepad No CSS Used
  21. How TO Create A Beautiful And Simple WebPage Using HTML Only (No CSS Used)