โ Back to Functions/Methods
Question 294
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: 1 Print1or0with%d.
Expected Output:
1
Topics:
Functions/Methods
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.