Computer Science, asked by Devadharshini30, 11 months ago

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 vrunda4878
0

Answer:

no her 15 th birthday would not be on leap year

Answered by ajinkyabiyani
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