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
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
What is the sizeof () operator?
What is const volatile variable in c?
Explain argument and its types.
What is the difference between text and binary i/o?
how to find anagram without using string functions using only loops in c programming
int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above
What is a pointer variable in c language?
Why clrscr is used in c?
What is an operator?
What is multidimensional arrays
What does return 1 means in c?
What are the advantages and disadvantages of pointers?
Explain how does free() know explain how much memory to release?
What are the usage of pointer in c?