/* William Strickland Project 3 Is Leap Year Portion */ #include #include #include "..\..\stdbool.h" bool isLeapYear(int *year); int main(int argc, char *argv[]) { int year = atoi(argv[4]); printf("Name: William Strickland \n"); printf("Is Leap Year \n"); if (isLeapYear(&year)) { printf("%d is a leap year", year); } else { printf("%d is not a leap year", year); } return 0; } bool isLeapYear(int *year) { if (*year % 4 == 0 && *year % 100 != 0) { return 1; } else if (*year % 100 == 0 && *year % 400 == 0) { return 1; } else { return 0; } }
U
User 11160377
@User 11160377