Write a c pgm for leap year
Answer Posted / aniket
#include <stdio.h>
#include <conio.h>
void main()
{
int year;
clrscr();
printf("\n\t : TO CHECK LEAP YEAR :");
printf("\n Enter your year : ");
scanf("%d", &year);
if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
{
printf("\n\a L E A P Y E A R");
}
else
{
printf("\n\a N O T L E A P Y E A R");
}
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What do you mean by dynamic memory allocation in c?
Explain what is the purpose of "extern" keyword in a function declaration?
What is wrong with this program statement? void = 10;
What are the keywords in c?
What is the difference between class and object in c?
What should malloc() do?
Explain what is the difference between a string and an array?
Explain how can you avoid including a header more than once?
Write a code to generate a series where the next element is the sum of last k terms.
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What are structural members?
Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.
Tell me what is null pointer in c?