- Difficulty: 8 kyu
- Stars: 442
- Votes: 4135
- Category: reference
- Tags: Fundamentals, Numbers, Data Types, Mathematics, Algorithms, Logic, Basic Language Features, Dates/Time
- Source: codewars
The first century spans from the year 1 up to and including the year 100, The second - from the year 101 up to and including the year 200, etc.
Given a year, return the century it is in.
Input , Output Examples ::
cpp centuryFromYear(1705) returns (18) centuryFromYear(1900) returns (19) centuryFromYear(1601) returns (17) centuryFromYear(2000) returns (20)
racket (century 1705) returns 18 (century 1900) returns 19 (century 1601) returns 17 (century 2000) returns 20
if:sql In SQL, you will be given a table `years` with a column `yr` for the year. Return a table with a column `century`.
Hope you enjoy it … Awaiting for Best Practice Codes
Enjoy Learning !!!
Solve It Here
Click the link below to solve it on Codewars:
This puzzle was posted by a Slackbot via a slash command. If you want to help work on the app, send a message to @Josh.
If you don’t want to see the coding puzzles when you visit the forum, you can go into your settings and mute the puzzles category.