Advertisement
dllbridge

Untitled

Jan 26th, 2025
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.62 KB | None | 0 0
  1.  
  2.  
  3. #include <stdio.h>
  4.  
  5.  
  6. //////////////////////////////////////////////////////////////
  7. int main( void )                                            //
  8. {
  9.    
  10.     int a;
  11.    
  12.     printf("input number of month: ");  scanf("%i", &a);
  13.    
  14.     if(a == 1 || a ==  3 ||
  15.        a == 5 || a ==  7 ||
  16.        a == 8 || a == 10 || a == 12) { printf(   "31 days\n"); return 0; }
  17.     if(a == 2)                       { printf("28/29 days\n"); return 0; }
  18.    
  19.     if(a  < 1 || a > 12)             { printf(   "Mistake\n"); return 0; }
  20.    
  21.                                        printf(   "30 days\n"); return 0;  
  22. }
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement