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


Please Help Members By Posting Answers For Below Questions

What are the differences between new and malloc in C?

604


When can you use a pointer with a function?

557


Differentiate call by value and call by reference?

560


What is self-referential structure in c programming?

651


What is function prototype in c language?

606






How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

15483


Can a pointer be static?

611


What is the purpose of sprintf() function?

593


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

657


What is variable initialization and why is it important?

611


Why is c called "mother" language?

851


#include int main(){ int i=10; int *ptr=&i; *ptr=(int *)20; printf("%d",i); return 0; } Output: 20 can anyone explain how came the output is 20

1255


Explain threaded binary trees?

670


Explain function?

655


differentiate built-in functions and user – defined functions.

614