+ 4

Leap year teller. what's the problem in it ? Can you fix it ?

#include <iostream> using namespace std; int main() { int days; cout<<"Enter Number of days in a year\n"; cin >>days; if(days>363) { if(days%4==0) { cout<<"Leap Year!\n"; } else { cout<<"Not leap year!\n"; } } else { cout<<"Invalid Input!\n"<<"Please enter days in a year!\n"; } return 0; }

14th Jun 2018, 5:14 PM
Shehroz Irfan
Shehroz Irfan - avatar
4 Answers
+ 5
Donna confused ?
14th Jun 2018, 5:40 PM
Shehroz Irfan
Shehroz Irfan - avatar
+ 5
Donna ok i got it !
15th Jun 2018, 5:03 PM
Shehroz Irfan
Shehroz Irfan - avatar
+ 4
14th Jun 2018, 5:40 PM
Shehroz Irfan
Shehroz Irfan - avatar
+ 2
replace %4 by %400
14th Jun 2018, 6:12 PM
Aveek Bhattacharyya
Aveek Bhattacharyya - avatar