The return type of isLeap is bool which has a value of either true or false. Complete the missing part of the following program:
#include <iostream>
using namespace std;
int main()
{
int year;
cin >> year;
if(isLeap(year)) {
cout << year << " is a leap year." << endl;
} else {
cout << year << " is a not leap year." << endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}
i do a sample buthas something wrong
i try three input 1111,1900&2000
1111-->is a leap year
1900-->is a leap year
2000-->is not aleap year
but it is reverse
what am i wrong???
#include <iostream>
using namespace std;
int isLeap(int);
int main()
{int year;
cin >> year;
if(isLeap(year)) {
cout << year << " is a leap year." << endl;
} else {
cout << year << " is a not leap year." << endl;
}