Write a c pgm for leap year

Answer Posted / kumari rina

#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("\n enter the year");
scanf("%d",&n);
if(n%100==0)
{
if(n%400==0)
{
printf("\n year is leap year");
}
else
{
printf("\n year is not leep year");
}
}
else
{
if(n%4)
{
printf("\n year is leap year");
}
else
{
printf("\nyear is not leap year");

}
}
getch();
}

Is This Answer Correct ?    12 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are header files and explain what are its uses in c programming?

603


a c code by using memory allocation for add ,multiply of sprase matrixes

2294


Explain what is the best way to comment out a section of code that contains comments?

710


Why do some versions of toupper act strangely if given an upper-case letter?

627


What is preprocessor with example?

577






What are the benefits of organizational structure?

566


What are the features of c language?

617


What is a global variable in c?

585


What is a ternary operator in c?

646


What does char * * argv mean in c?

618


What are the 5 organizational structures?

561


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

725


What does c in a circle mean?

573


What do you understand by friend-functions? How are they used?

640


What is the difference between fread and fwrite function?

632