+ 1

how we can do programming of leap year

5th Sep 2016, 8:19 PM
ANUJ CHITMITWAR
ANUJ CHITMITWAR - avatar
4 Respuestas
+ 2
You could do something like this: if (year % 4 == 0) { //leap year } else { //not a leap year }
5th Sep 2016, 9:14 PM
Cohen Creber
Cohen Creber - avatar
+ 1
if(year%4==0){ if((year%100==0)&&(year%400!=0)){ cout<<"not a leap year"; }else{ cout<<"its a leap year"; } }else{ cout<<"not a leap year"; }
10th Sep 2016, 8:57 PM
Pedro Gómez
Pedro Gómez - avatar
0
Thanks
6th Sep 2016, 11:21 AM
ANUJ CHITMITWAR
ANUJ CHITMITWAR - avatar
0
if(year % 4 == 0) cout<<"it is a leap year"; else cout<<"not a leap year";
10th Sep 2016, 6:40 AM
Manik Jain
Manik Jain - avatar