Lucy is celebrating her 15th birthday. Her father promised her that he will buy her a new computer on her birthday if she solves the question asked by him. He asks Lucy to find out whether the year on which she was born is a leap year or not. Help her to solve this puzzle so that she celebrates her birthday happily. If her birth year is 2016 and it is a leap year display “2016 is a leap year.” Else display “2016 is not a leap year.”
Answers
Answered by
0
Answer:
no her 15 th birthday would not be on leap year
Answered by
3
Answer:
#include<iostream>
using namespace std;
int main()
{
int year;
cin >> year;
if(year % 4 == 0) {
if(year % 100 == 0) {
if(year % 400 == 0) {
cout << year <<" is a leap year";
}
else{
cout << year <<" is a leap year";
}
}
else{
cout << year <<" is a leap year";
}
}
else{
cout << year <<" is not a leap year";
}
return 0;
}
Explanation:
Similar questions
India Languages,
5 months ago
Computer Science,
5 months ago
Science,
5 months ago
Science,
11 months ago
English,
11 months ago
Physics,
1 year ago
English,
1 year ago