LATEST PROGRAMS

WAP in C++ to check whether the entered year is leap year or not.

#include<iostream>
using namespace std;

int main()
{
    int yr;
    cout<<"Enter the year to be checked \n";
    cin>>yr;
    if(yr%4==0 && (yr%100!=0 || yr%400==0))
    cout<<yr<<" is a leap year ";
    else
    cout<<yr<<" is not a leap year ";
    return 0;
}
18/02/2023, 9:58 am Read : 114 times