Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int year;
- while(1){
- printf("Enter a year to check if its Leap year or not\n");
- printf("Press 0 to exit the program\n");
- scanf("%d",&year);
- if(year==0)
- {
- break;
- }
- else if(year%4==0)
- {
- printf("%d is a leap year\n",year);
- }
- else
- {
- printf("%d is not a leap year\n",year);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement