Advertisement
suhdud

1.Zadatak Week 3

Mar 27th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  5.  
  6. int main(int argc, char *argv[]) {
  7.     int mesec,i,dan,godina,more;
  8.     int mesecovi[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
  9.     more = 0;
  10.     printf("Upisi mesec :");
  11.     scanf("%d",&mesec);
  12.     printf("Upisi dan :");
  13.     scanf("%d",&dan);
  14.     printf("Upisi godinu :");
  15.     scanf("%d",&godina);
  16.    
  17.     for (i=0;i < mesec-1;i++)
  18.     {
  19.         more = more + mesecovi[i];
  20.     }
  21.    
  22.     printf("Datum koji ste upisali %d.%d.%d",mesec,dan,godina);
  23.     printf("\nproslo je %d od %d godine ",more+dan,godina);
  24.    
  25.    
  26.    
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement