Problem 2858. Matlab Basics - Logical Tests I
Write a script to test whether a year number is for a leap year or not.
eg. x = 1884 output = 1
eg. x = 3 output = 0
Solution Stats
Problem Comments
-
1 Comment
Elmar Zander
on 29 Mar 2017
The test cases are too trivial. E.g. 2000 was a leap year, but 1900 or 1800 was not... (At least after the Gregorian calendar reform)
Solution Comments
Show commentsProblem Recent Solvers254
Suggested Problems
-
The Hitchhiker's Guide to MATLAB
3276 Solvers
-
1182 Solvers
-
Longest run of consecutive numbers
5325 Solvers
-
Duplicate each element of a vector.
601 Solvers
-
Finding an element in a vector
184 Solvers
More from this Author28
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!