Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- main()
- {
- int d, m, g, prestupna, rd;
- printf("Uneti redni broj dana u mesecu\n");
- printf("\td=");
- scanf("%d", &d);
- printf("Uneti redni broj meseca u godini\n");
- printf("\tm=");
- scanf("%d", &m);
- printf("Uneti godinu\n");
- printf("\tg=");
- scanf("%d", &g);
- switch(m-1)
- {
- case 11:
- d+=30;
- case 10:
- d+=31;
- case 9:
- d+=30;
- case 8:
- d+=31;
- case 7:
- d+=31;
- case 6:
- d+=30;
- case 5:
- d+=31;
- case 4:
- d+=30;
- case 3:
- d+=31;
- case 2:
- if(g%400==0 || (g%4==0 && g%100 !=0))
- d+=29;
- else
- d+=28;
- case 1:
- d+=31;
- }
- printf("%d. dan po redu", d);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement