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


Please Help Members By Posting Answers For Below Questions

What is c value paradox explain?

565


How can I avoid the abort, retry, fail messages?

651


How can I sort more data than will fit in memory?

619


What is pivot in c?

562


What is the use of a semicolon (;) at the end of every program statement?

762






When is a null pointer used?

633


How a string is stored in c?

576


What are linker error?

612


What are different storage class specifiers in c?

611


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2298


What is the difference between formatted&unformatted i/o functions?

610


Explain the use of function toupper() with and example code?

647


Which is better oop or procedural?

622


what will be the output for the following main() { printf("hi" "hello"); }

9302


define string ?

660