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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!