Question: Specification Write an ANSI-C program that reads an integer from standard input, which represents a year, and then determines if the year is a leap

Specification Write an ANSI-C program that reads an integer from standard input, which represents a year, and then determines if the year is a leap year. Implementation name your program lab3 Leap.c keep on reading a (4 digit) integer of year, until a negative number is entered. define a 'Boolean' function int isLeap (int year) which determines if year represents a leap year. A year is a leap year if the year is divisible by 4 but not by 100, or otherwise, is divisible by 400. put the definition (implementation) of function is Leap after your main function. 4.3 Sample Inputs/Outputs: red 364 % gcc -Wali lab3Leap.c -o leap red 365 % leap Enter a year: 2010 Year 2010 is not a leap year Enter a year: 2012 Year 2012 is a leap year Enter a year: 2017 Year 2017 is not a leap year Enter a year: 2018 Year 2018 is not a leap year Enter a year: 2019 Year 2019 is not a leap year Enter a year: 2020 Year 2020 is a leap year Enter a year: 2200 Year 2200 is not a leap year Enter a year: 2300 Year 2300 is not a leap year Enter a year: 2400 Year 2400 is a leap year Enter a year: 2500 Year 2500 is not a leap year Enter a year: -6 red 366 %
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
