Please help me get whatever points still possible to get. It was due earlier. I
ID: 3884527 • Letter: P
Question
Please help me get whatever points still possible to get. It was due earlier. I didn't see the posting til 5 min ago. Java eclipse neon related stuff. Show all steps please.
Explanation / Answer
Question 1:
LoopTest.java
public class LoopTest {
public static void main(String[] args) {
int i,j,n = 15;
for(i=1;i<=n;i+=5) {
for(j=i;j<i+5;j++) {
System.out.print(j+" ");
}
System.out.println();
}
}
}
Output:
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
Question 2
Answer:
LoopTest.java
public class LoopTest {
public static void main(String[] args) {
int i=1,counter = 5,n = 15;
while(i<=n) {
System.out.print(i+" ");
if(i% counter ==0) {
System.out.println();
}
i++;
}
}
}
Output:
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15