how to work out the leap year

Write your question here.
cin a year,and judge if it is a leap year.

1
2
int year; 
if(cin >> year && year % 4 == 0) cout << "It is a leap year!!!!\n";
Last edited on
Topic archived. No new replies allowed.