Answer to Question #45387 in C for dip malo

Question #45387
Write a program in c input a year and display it lave year or not.
1
Expert's answer
2014-08-28T05:28:26-0400
#include <stdio.h>
int main() {
int year = 0;
printf("Please input the year to be validated\n");
scanf("%d", &year);
if ((year % 4 == 0 && year % 100 != 0) || $year % 400 ) {
printf("Year is leap.\n");
} else {
printf("Year is not leap\n");
}
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS