Skip to main content

Check Weather Entered Year is Leap Or Not

Check Weather Entered Year is Leap Or Not




#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int year;
printf("enter the year");
scanf("%d",year);
if ((year %400==0)&&year%4==0||(year%100!=0))
{
printf("leap year");
}
else
{
printf("not a leap year");
}
getch();
}

Comments

Popular posts from this blog

C++ Program Finding The Absolute Value

#include<iostream> using namespace std; int main() { cout<<" enter any number"; cin>>num; if(num>0) { cout<<"The absolute value of number is:"<< num; } else { cout<<"The absolute value of number is :"<< -(num); } return 0; } OUTPUT Enter Any number: 2 The absolute value of number is 2