We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e4d9d9 commit 6144dd1Copy full SHA for 6144dd1
Numbers/Basic_Programs/Leap year program using functions.c
@@ -0,0 +1,34 @@
1
+#include <stdio.h>
2
+
3
+void is_leap_year(int year)
4
+{
5
+if(year%4 == 0)
6
7
+if( year%100 == 0)
8
9
+if ( year%400 == 0)
10
+printf(“%d is a leap year”, year);
11
+else
12
+printf(“%d is not a leap year”, year);
13
+}
14
15
16
17
18
19
+printf(“\n”);
20
21
22
+int main()
23
24
+int year;
25
+printf(“\nEnter a year : “);
26
+scanf(“%d”,&year);
27
28
+is_leap_year(year);
29
+return 0;
30
31
32
+/* Output
33
+Input- Enter a year:1998 Output- 1998 is not a leap year
34
+/*
0 commit comments