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 is new line escape sequence?
write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare. You will then tabulate this information in another file.
What is the difference between class and object in c?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
What are actual arguments?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
What header files do I need in order to define the standard library functions I use?
What is the difference between union and anonymous union?
Write a program for Overriding.
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
What is the process of writing the null pointer?
Why we use break in c?
How was c created?
Explain how can a program be made to print the name of a source file where an error occurs?
What do you mean by dynamic memory allocation in c?