public class JavaApplication64 {
public static void main(String[] args) {
int count = 0;
for (int i = 23; i <= 89; i++){
if (count == 10){
System.out.println("");
count = 0;
}
System.out.print(i+" ");
count += 1;
}
}
}
I hope this helps!
Answer:
1000 500 250 125 the output
Explanation:
write a program using integers userNum and x as input, userNum divided by
x four times. EX : If the input is 2000 2 the output is 1000 500 250 125
Answer:
result = 0
i = lo
while i <= hi:
result = result + i
i += 1
Explanation:
Initialize the <em>result</em> as 0 to hold the summation value.
Since we are asked not to change the value of <em>lo</em> and <em>hi</em>, our loop control variable is <em>i</em> and initially it starts from <em>lo.</em>
Since we are asked to add the number from <em>lo</em> to <em>hi, </em>while loop condition checks it.
While the condition satisfies (during each iteration), the value of <em>i</em> is added to the result and the value of <em>i</em> is incremented by one.