Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Napisać program sprawdzający czy dany rok wprowadzony z klawiatury jest przestępny czy nie
- //
- #include <stdio.h>
- #include <stdlib.h>
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- int main() {
- int x=1;
- printf("0 konczy program\n");
- printf("Podaj rok\n");
- scanf("%d", &x);
- do{
- if ((x%4==0 && x%100!=0) || x%400==0){
- printf("Rok przestepny\n");
- } else {
- printf("rok nie przestepny\n");
- }
- scanf("%d", &x);
- }while(x!=0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement