Question: Java Help Write a program that uses a for loop to print a list of 100 numbers consisting of alternating 1s and -1s, starting with
Java Help
Write a program that uses a for loop to print a list of 100 numbers consisting of alternating 1s and -1s, starting with 1.
Use 2 loop control variables.
Sample Output from System.out.println
i = 1 / j = -1
i = 2 / j = -2
i = 3 / j = -3
i = 4 / j = -4
i = 5 / j = -5
i = 6 / j = -6
i = 7 / j = -7
i = 8 / j = -8
i = 9 / j = -9
i = 10 / j = -10
cont
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
