progress
This commit is contained in:
29
programs/a4/main.c
Normal file
29
programs/a4/main.c
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int month;
|
||||
|
||||
printf("Input month: ");
|
||||
scanf("%d", &month);
|
||||
|
||||
if (month < 1 || month > 12) {
|
||||
puts("Unknown month");
|
||||
return 1;
|
||||
}
|
||||
|
||||
switch (month) {
|
||||
case 2:
|
||||
puts("28 days");
|
||||
break;
|
||||
case 4:
|
||||
case 6:
|
||||
case 9:
|
||||
case 11:
|
||||
puts("30 days");
|
||||
break;
|
||||
default:
|
||||
puts("31 days");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user