summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSadeep Madurange <smadurange@users.noreply.github.com>2022-01-04 18:48:07 +0800
committerSadeep Madurange <smadurange@users.noreply.github.com>2022-01-04 18:48:07 +0800
commitba79458b94b9ccb3bf93015c61189e53c8176f9c (patch)
treeac7eea18e5799cc5f0e4396bff4e99a13bf32a5c
parent9eaa5264381f5355c26ced80ec91c8cb156c339f (diff)
downloadk&r-exercises-ba79458b94b9ccb3bf93015c61189e53c8176f9c.tar.gz
5.8
-rw-r--r--5/8.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/5/8.c b/5/8.c
index f1bbc7f..a1284d6 100644
--- a/5/8.c
+++ b/5/8.c
@@ -1,15 +1,10 @@
#include <stdio.h>
-/* Sets day of year from month and day */
-int day_of_year(int year, int month, int day);
-
-/* Sets month and day from day of year */
-void month_day(int year, int yearday, int *pmonth, int *pday);
-
static char daytab[2][13] = {
{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
{0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};
+/* Sets day of year from month and day */
int day_of_year(int year, int month, int day) {
int i, leap;
@@ -37,6 +32,7 @@ int day_of_year(int year, int month, int day) {
return day;
}
+/* Sets month and day from day of year */
void month_day(int year, int yearday, int *pmonth, int *pday) {
int i, leap;