Recent Posts

9-latest-250px-course

Write a C program Leap year program

Write a C program Leap year program


Program:-     

#include <stdio.h>

int main()

{

int year;

printf(“Enter a year: “);

scanf(“%d”,&year);

printf(“\n”);

if(year%4 == 0)

{

if( year%100 == 0)

{

if ( year%400 == 0)

printf(“%d is a leap year”, year);

else

printf(“%d is not a leap year”, year);

}

else

printf(“%d is a leap year”, year );

}

else

printf(“%d is not a leap year”, year);

printf(“\n”);

return 0;

}

Output:-

....
SHARE

Milan Tomic

Hi. I’m Designer of Blog Magic. I’m CEO/Founder of ThemeXpose. I’m Creative Art Director, Web Designer, UI/UX Designer, Interaction Designer, Industrial Designer, Web Developer, Business Enthusiast, StartUp Enthusiast, Speaker, Writer and Photographer. Inspired to make things looks better.

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment