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

How can you find the exact size of a data type in c?

602


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.

1481


What does stand for?

599


What is getch?

633


What is a structure member in c?

551






When the macros gets expanded?

791


Is a house a shell structure?

698


What do you mean by dynamic memory allocation in c?

653


What is difference between scanf and gets?

615


Explain what is the difference between a free-standing and a hosted environment?

636


Are bit fields portable?

680


Is javascript written in c?

585


The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference

676


What is the purpose of macro in C language?

664


Why we use int main and void main?

538