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 do you mean by a local block?
How does pointer work in c?
How can I open a file so that other programs can update it at the same time?
Why doesn't C support function overloading?
What language is windows 1.0 written?
Is return a keyword in c?
What is a null string in c?
Explain goto?
Why doesnt this code work?
What's the difference between constant char *p and char * constant p?
Explain what are binary trees?
Explain the difference between getch() and getche() in c?
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
Why doesnt that code work?
What is a lookup table in c?