#include<iostream> using namespace std; int main() { int n; cout<<"Enter a year:"; cin>>n; if(n%400==0) cout<<"\nNot a leap year."; else if(n%100==0) cout<<"\nNot a leap year."; else if(n%4==0) cout<<"\nIt's a leap year."; else cout<<"It's not a leap year."; system("pause"); return 0; }Output: Enter a year:2012 It's a leap year.
No comments:
Post a Comment