← Back to Functions/Methods
Question 364
Function: Is Leap Year
Function: Is Leap Year
Write a functionisLeap(int y)that returns1if yearyis a leap year, else0. A year is a leap year when it is divisible by 4, except centuries, which must be divisible by 400. Read a year from input and print the result. For input2000the output is exactly what is shown in Expected Output. Print1or0with%d.
Expected Output:
1= newline. No newline after the last line.
Hints2 available
Sign in to use hintsTopics:
Functions/Methods
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.