Preskoči na glavni sadržaj
Prijava
Sign up for FREE
arrow_back
Biblioteka

For Loops Worksheet

star
star
star
star
star
Posljednje ažuriranje about 2 years ago
5

DIRECTIONS : Fill in each blank with the correct answer/output. Assume each statement happens in order and that one statement may affect the next statement. Some sections might print more than once.

1
Pitanje 1
1.

for(int i=-3; i<19; i=i+3)

{

out.print(i + " ");

}

1
Pitanje 2
2.

for(int j=17; j>-2; j=j-2)

{

out.print(j + " ");

}

1
1
1
Pitanje 3
3.

for(int x=20; x<50; x=x+3)

{

out.print(x + " ");

}

Pitanje 4
4.

for(int m=37; m>0; m=m-4)

{

out.print(m + " ");

}

Pitanje 5
5.

int total=0;

for(int s=1; s<19; s++)

{

total=total+s;

}

out.println(total);