#include <stdio.h>
int main()
{
int month, days;
printf("Put the month.");
scanf("%d", &month);
switch(month) //switch(the name of the value
{
case 4:
case 6:
case 9:
case 11:
days = 30;
break;
case 2 :
days = 28;
break;
default :
days = 30;
break;
}
printf("Total days of %d is %d",month, days);
return 0;
}
int main()
{
int month, days;
printf("Put the month.");
scanf("%d", &month);
switch(month) //switch(the name of the value
{
case 4:
case 6:
case 9:
case 11:
days = 30;
break;
case 2 :
days = 28;
break;
default :
days = 30;
break;
}
printf("Total days of %d is %d",month, days);
return 0;
}
댓글
댓글 쓰기