switch statement in c++ in hindi

Switch Statement In C++ In Hindi – C++ Switch Condition In Hindi

C++

Switch Statement In C++ in Hindi : Jab Kisi Program Me Bahut Sari if condition Ka Istemal Karte Hai to Program Bahut Jyada Complex Ban Jata Hai jisse Samanjh Ne Me Jyada Dikkat Hoti Hai | Issi se Bachne Ke Liye Ham Switch Statement in hindi ko Istemal karte Hai |

Switch Statement In C++ In Hindi

Contents

C++ Switch Statement In Hindi Ek Conditional Branching Statement Hai Jiska Pryog Ek Variable Ki Value Ke Anushar Bahut Sare Case Ko Check Karne Ke Liye Kiya Jata Hai | Iski Shurwat Mei Switch Statement In Hindi Ke Sath Ek Variable Hota Hai, Bich Mei Case Statement Ke Sath Bahut Sare Statement Block Hote Hai Or End Mei Default Statement Ke Sath Default Statement BLock Hota Hai | Isme Shurwat Se Ek Ek Karke Variable Ki Value Ke Sath Sabhi Case Ko Check Kiya Jata Hai | Yadi Koi Bhi Case Variable Ki Value Se Match Karta Hai To Is Case Ke Under Likhe Statement Block Ko Execute Kiya Jata Hai | Or Yadi Koi Bhi Case Variable ki Value Se Match Nahi Karta Hai | To End Mei Default Statement Block Ko Execute Kiya Jata Hai | Iska Syntax Aap Niche Dekh Sakte Hai |

Syntax Switch Statement

switch (n)
{
    case 1:      // code to be executed if n = 1;
        break;

    case 2:     // code to be executed if n = 2;
        break;

    default: 
               // code to be executed if n doesn't match any cases
}

Flow Chart Switch Statement In C++

Aap Niche Diye Gaye Flow Chart Ko Dekh Kar Switch Statement in CPP in Hindi Ko Understand Kar Sakte Hai |

Switch Statement In C++ & C In Hindi

Switch Case Statement Example in Hindi :

Example 1:

#include <iostream>

using namespace std;

int main()
{
    int x; 
   cout << "Enter Your Choice Between 1 and 3 :"; 
   cin>>x;
   
   
switch (x) 

    { 
    	case 1: cout << "Your Choice No 1"; 
    		break; 
    
    	case 2: cout << "Your Choice No 2"; 
    		break; 
    
    	case 3: cout << "Your Choice No 3"; 
    		break; 
    
    	default: 
                   cout << "Wrong Input";  
    	       break; 
    } 

}

Output:

Enter Your Choice Between 1 and 3 :1                                                                                          
Your Choice No 1  

Example 2:

#include <iostream.h>
#include <conio.h>

int main() 
{

  char Day='D';

switch(Day)
{

case 'A' :
cout<<"\nToday is Sunday";
break;

case 'B' :
cout<<"\nToday is Monday";
break;

case 'C' :
cout<<"\nToday is Tuesday";
break;

case 'D' :

case 'E' :
cout<<"\nToday is Wednesday";
break;

case 'F' :
cout<<"\nToday is Thurday";
break;

case 'G' :
cout<<"\nToday is Friday";
break;

case 'H' :
cout<<"\nToday is Saturday";
break;

default :
cout<<"\nDay is Not Found";
}
return 0;
}

C++ Switch Case Condition In Hindi

Read Also This Post :-

C++ Switch Condition In Hindi

Dosto mujhe ummed hai ki aap C++ Switch Statement 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 |

Leave a Reply

Your email address will not be published. Required fields are marked *