Switch case program
1.Write a program to accept month number and display the name of the month
2.write a program to accept two numbers from users and display win,product ,difference,quotient and remainder as per the user's choice
ananya071:
isr or not
Answers
Answered by
4
main()
{
int a;
clrscr();
printf("Enter number between 1 to 12");
scanf("%d",&a);
switch(a)
{
case 1:
printf("Jan");
break();
case 2:
printf("Feb");
break();
case 3:
printf("Mar");
break();
case 4:
printf("Apr");
break();
case 5:
printf("May");
break();
case 6:
printf("Jun");
break();
case 7:
printf("July");
break();
case 8:
printf("Aug");
break();
case 9:
printf("Sept");
break();
case 10:
printf("Oct");
break();
case 11:
printf("Nov");
break();
case 12:
printf("Dec");
break();
deafult:
printf("Enter valid number");
break();
}
getch():
}
{
int a;
clrscr();
printf("Enter number between 1 to 12");
scanf("%d",&a);
switch(a)
{
case 1:
printf("Jan");
break();
case 2:
printf("Feb");
break();
case 3:
printf("Mar");
break();
case 4:
printf("Apr");
break();
case 5:
printf("May");
break();
case 6:
printf("Jun");
break();
case 7:
printf("July");
break();
case 8:
printf("Aug");
break();
case 9:
printf("Sept");
break();
case 10:
printf("Oct");
break();
case 11:
printf("Nov");
break();
case 12:
printf("Dec");
break();
deafult:
printf("Enter valid number");
break();
}
getch():
}
Similar questions