Consider February 28days long
int days(int month, int day) {
int i;
int count = 0;
int v[12]={31,28,31,30,31,30,31,31,30,31,30,31};
for(i=0;i<month-1;i++) {
count+=v[i];
}
count = count + day;
return count;
}
// TODO: Replace examples and use TDD by writing your own tests. The code provided here is just a how-to example.
#include <criterion/criterion.h>
// replace with the actual method being tested
int days(int month, int day);
Test(Test, Days) {
cr_assert_eq(days(3, 1), 60);
cr_assert_eq(days(12, 31), 365);
cr_assert_eq(days(1, 1), 1);
cr_assert_eq(days(9, 17), 260);
}