70.1k views
4 votes
convert totalyears to centuries, decades, and years, finding the maximum number of centuries, then decades, then years. ex: if the input is 316, then the output is:

User Alfageme
by
7.4k points

1 Answer

3 votes

Final answer:

To convert total years to centuries, decades, and years, divide the total years by 100 to find the number of centuries. Divide the remaining years by 10 to find the number of decades. The remaining years are the output for the years.

Step-by-step explanation:

To convert total years to centuries, decades, and years, we need to understand how many years make up a century, a decade, and a year.

1 century = 100 years

1 decade = 10 years

Therefore, to find the maximum number of centuries, we divide the total years by 100. The quotient would be the number of centuries. Next, we divide the remaining years (after subtracting the centuries) by 10 to find the maximum number of decades. Finally, the remaining years would be the output for the years.

Let's look at an example: if the input is 316, we can calculate as follows:

316 years = 3 centuries + 1 decade + 6 years