+ 1
how we can do programming of leap year
4 Respostas
+ 2
You could do something like this:
if (year % 4 == 0)
{
//leap year
}
else
{
//not a leap year
}
+ 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";
}
0
Thanks
0
if(year % 4 == 0)
cout<<"it is a leap year";
else
cout<<"not a leap year";