exactly what are you trying to ask?
Your code compiles fine in GCC
Your code works.
Only it needs some cleaning up
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
#include <iostream>
using namespace std;
int main()
{
int yr;
cout << "Enter year : ";
cin >> yr;
if(yr % 4 == 0 && (yr % 100 != 0 || yr % 400==0)){
cout << yr << " is Leap year \n";
}else{
cout << yr <<" is Not a Leap year\n";
}
return 0;
}
|
Last edited on