first semester files
This commit is contained in:
15
1st-Semester-Fall-2021/CSNP/LeapYear.cpp
Executable file
15
1st-Semester-Fall-2021/CSNP/LeapYear.cpp
Executable file
@@ -0,0 +1,15 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
int year;
|
||||
|
||||
cout << "Enter a year: ";
|
||||
cin >> year;
|
||||
|
||||
cout << " is" << (( year >= 1582 && (year % 100 != 0 || year % 400 == 0) && year % 4 == 0) ? " " : " not ") << "a leap year.";
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user