Get Update on recent Technology & Programming

Wednesday, 15 November 2017

C Program to find whether a year is leap or not

Posted by   on Pinterest

C Program to find whether a year is leap or not







#include<stdio.h>

int main(void)

{

 int year;

 printf("Enter year : ");

 scanf("%d",&year);



 if(year%100 != 0)

 {

  if(year%4 == 0)

   printf("Leap year\n");

  else

   printf("Not leap\n");  

 }

 else

 { 

  if(year%400 == 0)

   printf("Leap year\n");

  else

   printf("Not leap\n");

 }

 return 0;

}



No comments:
Write comments

Hey, we've just launched a new custom color Blogger template. You'll like it -
Join Our Newsletter