Program of switch & break
/*
number of days of a particular month*/
#include<stdio.h>
main()
{
int mno;
{
int mno;
switch(mno)
{
case 1; printf(“31 days”);
case 3;
case 5;
case 7;
case 8;
case 3;
case 5;
case 7;
case 8;
case 10;
case 12; printf(“31 daya”);break;
case 4;
case 6;
case 9;
case 11;printf(“30 days”);break;
case 6;
case 9;
case 11;printf(“30 days”);break;
case 13;printf(“invalide number”);
case 2;printf(“28 or 29 days”);
}
}
No comments:
Post a Comment