fork download
  1. #include <stdio.h>
  2. #define MONTHS 12
  3.  
  4. int main(void) {
  5. int days[MONTHS] = {31,28,31,30,31,30,31,31,30,31,30,31};
  6. int index;
  7.  
  8. for (index = 0; index < MONTHS; index++)
  9. printf("%d %d \n", index +1, days[index] );
  10. return 0;
  11. }
  12.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
1 31 
2 28 
3 31 
4 30 
5 31 
6 30 
7 31 
8 31 
9 30 
10 31 
11 30 
12 31