Write a c pgm for leap year
Answer Posted / azad sable,chiplun.
void main()
{
int yr;
clrscr();
printf("enter the year");
scanf("%d",&yr);
if(yr%100==0)
{
if(yr%400==0)
printf("\nLeap year");
else
printf(\nNot aleap year");
}
else
{
if(yr%4==0)
printf(\nLeap yaer");
else
printf("\nNot a leap year");
}
getch();
}
| Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
What is the difference between array and pointer in c?
Difference between linking and loading?
Explain the difference between null pointer and void pointer.
What is the purpose of sprintf() function?
What is default value of global variable in c?
What does static variable mean in c?
What are the disadvantages of external storage class?
Write a program to identify if a given binary tree is balanced or not.
Explain what math functions are available for integers? For floating point?
Explain what is the difference between the expression '++a' and 'a++'?
What is a pragma?
Write a program to swap two numbers without using third variable in c?
How variables are declared in c?
write a program to display all prime numbers
Describe the header file and its usage in c programming?