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 a rvalue?
What is exit() function?
What is the difference between functions getch() and getche()?
Is there anything like an ifdef for typedefs?
What is modeling?
What is openmp in c?
Why C language is a procedural language?
How can I find the modification date and time of a file?
What is double pointer in c?
how many errors in c explain deply
Explain what are the __date__ and __time__ preprocessor commands?
Which is best linux os?
Why can’t constant values be used to define an array’s initial size?
What are the benefits of organizational structure?
What is clrscr in c?