Any year is input through the keyboard. Write a program to determine whether the year is a leap year or not.

#include

int main ()

 {

 int y;

 printf( "Enter a year: " );

 scanf( "%d" ,&y);

 if(y%4==0 && y%100!=0)

 printf( "\nLeap Year" );

 else if(y%400==0)

 printf( "\nLeap Year" );

 else

 printf( "\nNot Leap Year" );

 return 0;

 }
Next Post Previous Post
No Comment
Add Comment
comment url