Switch Statement In C | switch case statement in c language in Hindi

Switch Statement In C: 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 issi se bachne ne ke liye ham switch statement in hindi ka use karte hai.

Switch Statement In C

Jis Tarah If Else Condition kaam karti ussi tarah switch statement kaam karta 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

switch case statement in c language in Hindi

Switch Statement Example :

#include <stdio.h> 
#include <conio.h>

int main() 
{ 
int x; 
clrscr();
printf("Enter The Choice No :");
scanf("%d",&x);

switch (x) 

{ 
 case 1: printf("Choice is 1"); 
  break; 

 case 2: printf("Choice is 2"); 
  break; 

 case 3: printf("Choice is 3"); 
  break; 

 default: 
               printf("Wrong Input"); 
        break; 
} 
return 0; 
getch();
} 

Output:

Enter The Choice No:3
Choice is 3

Dosto mujhe ummed hai ki aap 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 |

Danish Ali

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

View Comments

Share
Published by
Danish Ali

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