Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Program to check if a year is a leap year.
- #include<iostream.h>
- #include<conio.h>
- void main()
- {
- clrscr();
- int a,b;
- cout<<"Enter a year: ";
- cin>>a;
- if(a%400==0)
- cout<<"It's a leap year"<<endl;
- else if(a%100==0)
- cout<<"It's not a leap year"<<endl;
- else if(a%4==0)
- cout<<"It's a leap year"<<endl;
- else
- cout<<"It's not a leap year"<<endl;
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment