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
What are header files and explain what are its uses in c programming?
a c code by using memory allocation for add ,multiply of sprase matrixes
Explain what is the best way to comment out a section of code that contains comments?
Why do some versions of toupper act strangely if given an upper-case letter?
What is preprocessor with example?
What are the benefits of organizational structure?
What are the features of c language?
What is a global variable in c?
What is a ternary operator in c?
What does char * * argv mean in c?
What are the 5 organizational structures?
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
What does c in a circle mean?
What do you understand by friend-functions? How are they used?
What is the difference between fread and fwrite function?