Write a c pgm for leap year
Answer Posted / narayan sharma
#include<stdio.h>
#include<conio.h>
void main()
{
int y;
clrscr();
printf("\n\n\t Enter The Year\n\n\t");
scanf("%d",&y);
if (y%100==0)
{
if (y%400==0)
printf("\n\n\t Leep Year\n\n");
else
printf("\n\n\tNot Leep\n\n\t");
}
else
{
if (y%4==0)
printf("\n\n\t Leep Year\n\n\t");
else
printf("\n\n\t Not Leep");
}
getch();
}
Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
What are the differences between new and malloc in C?
When can you use a pointer with a function?
Differentiate call by value and call by reference?
What is self-referential structure in c programming?
What is function prototype in c language?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
Can a pointer be static?
What is the purpose of sprintf() function?
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file
What is variable initialization and why is it important?
Why is c called "mother" language?
#include
Explain threaded binary trees?
Explain function?
differentiate built-in functions and user – defined functions.