commit d89770e070647bca1d1e306201a0c102c7584968
parent 4067f1232dfe47b5515e0dc11e922b866b189ffc
Author: Amit Dutta <amitdutta4255@gmail.com>
Date: Sun, 5 Oct 2025 21:13:42 +0530
update luc024
Diffstat:
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/letusc-exercises/luc024.c b/letusc-exercises/luc024.c
@@ -0,0 +1,14 @@
+/* Write a program using conditional operators to determine whether
+a year entered through the keyboard is a leap year or not. */
+/* Author - Amit Dutta, Date - 4rd OCT, 2025 */
+/* Let Us C, Chap- 4, Page - 72, Qn No.: E(b) */
+
+#include <stdio.h>
+int main()
+{
+ int year;
+ printf("Enter the year : ");
+ scanf("%d", &year);
+ printf("\nYear %d is %s a Leapyear.", year, (year % 400 == 0 || year % 4 == 0 && year % 100 != 0) ? "" : "NOT");
+ return 0;
+}+
\ No newline at end of file