Switch_program

// Ask for branch & sem and print its no of students
#include<stdio.h>
#include<conio.h>
void main()
{
int ch;
clrscr();
printf("\n Which Branch you want?");
printf("\n 1.BCA");
printf("\n 2.BSc.IT.");
printf("\n Your Choice:-");
scanf("%d",&ch);
switch(ch)
{
case 1:
printf("\n Enter semester:-");
scanf("%d",&ch);
switch(ch)
{
case 1:
printf("\n No of Students are 100");
break;
case 3:
printf("\n No of Students are 200");
break;
case 5:
printf("\n No of Students are 300");
break;
}
break;
case 2:
printf("\n Enter semester:-");
scanf("%d",&ch);
switch(ch)
{
case 1:
printf("\n No of Students are 120");
break;
case 3:
printf("\n No of Students are 220");
break;
case 5:
printf("\n No of Students are 320");
break;
}
break;
}
}

No comments:

Post a Comment