Write a c pgm for leap year

Answer Posted / aniket

#include <stdio.h>
#include <conio.h>

void main()
{
int year;
clrscr();

printf("\n\t : TO CHECK LEAP YEAR :");
printf("\n Enter your year : ");
scanf("%d", &year);

if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
{
printf("\n\a L E A P Y E A R");
}
else
{
printf("\n\a N O T L E A P Y E A R");
}
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are its uses in c programming?

598


What is character constants?

715


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

667


what is ur strangth & weekness

1821


What is the method to save data in stack data structure type?

609






What is the size of enum in bytes?

591


how to capitalise first letter of each word in a given string?

1435


What is the use of a semicolon (;) at the end of every program statement?

776


What is a function simple definition?

621


Can you please explain the difference between malloc() and calloc() function?

622


Write a program in c to replace any vowel in a string with z?

698


How can I do peek and poke in c?

622


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

2986


How can I find out how much free space is available on disk?

631


Explain why can’t constant values be used to define an array’s initial size?

857