C LAB‎ > ‎(Sem1) Introduction to C‎ > ‎

WAP to check whether entered number is a leap year or not.

posted Nov 17, 2010, 5:47 AM by Neil Mathew   [ updated Nov 18, 2010, 4:44 AM ]


SOURCE CODE:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>
 
main()
{
 int Y;
 printf("Enter any year: ");
 scanf("%d", &Y);
 
 if((Y%4==0))
  printf("\nThe entered year is a Leap Year.");
 else
  printf("\nThe entered year is not a Leap Year.");
 
return 0;
}

 

 

OUTPUT:


Enter any year: 1991
The entered year is not a Leap Year.


Enter any year: 1994
The entered year is a Leap Year.

 


Comments