Question: **In Java please** As you know, the mod operator (%) gives you the remainder from an integer division operation, for example, 25 % 10 is
**In Java please**
As you know, the "mod" operator (%) gives you the remainder from an integer division operation, for example, 25 % 10 is 5. Suppose you have a repeating sequence of numbers like this:
1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 0, ...
Write a line of code that determines the one millionth number in this sequence.
Hint: First look at a simpler question such as, what's the 20th number in the sequence? And what's the value of 20 % 7 ? How about the 25th number?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
