101k views
17 votes
How many times would the for loop below execute if variable times = 9 % 2?

for (int x=times; x <=times; x++) ?

1
0
2
3

User Alexrnov
by
6.6k points

1 Answer

6 votes

Answer:

1

Step-by-step explanation:

9 % 2 = 1

So x = 1

It will execute once

User Ryan Lavelle
by
6.5k points