Home » Sometech » WAP to check whether a year is Leap year or not.

WAP to check whether a year is Leap year or not.

#include <stdio.h>

void main(void)

{

           int year;

           printf(“Enter Year:”);

           scanf(“%d”, &year);

      if(((year%4==0)&&(year%100!=0)) || (year%400==0))

           printf(“\n%d is a Leap Year”,year);

      else             

           printf(“\n%d is not a Leap Year”,year);

      getch();

}

Advertisements

SoME Tech

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

%d bloggers like this: