Sunday 27 April 2014

Filled Under:

WAP to find whether it is leap year or not?

#include <stdio.h>
void main()
{
  int year;

  printf("Enter a year to check if it is a leap year\n");
  scanf("%d", &year);

   if ( (year%4 == 0)  ||(year%100==0) && (year%400==0))
   {
       printf("leap year");
   }
  else
  printf("not leap ");
  getch();
  }

0 comments:

Post a Comment