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 are # preprocessor operator in c?
What is the use of #include in c?
What is a far pointer in c?
What is the difference between arrays and pointers?
What is the difference between typedef and #define?
What is the use of clrscr?
Which is the memory area not included in C program? give the reason
Write a factorial program using C.
What is scope and lifetime of a variable in c?
What do the functions atoi(), itoa() and gcvt() do?
In C programming, what command or code can be used to determine if a number of odd or even?
What type is sizeof?
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
Is c procedural or functional?
Can I initialize unions?