Log in
Sign up for FREE
arrow_back
Library
For Loops Worksheet
By Mickey Arnold
star
star
star
star
star
Share
share
Last updated almost 2 years ago
5 questions
Add this activity
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
1
1
1
1
Question 1
1.
for(int i=-3; i<19; i=i+3)
{
out.print(i + " ");
}
Question 2
2.
for(int j=17; j>-2; j=j-2)
{
out.print(j + " ");
}
Question 3
3.
for(int x=20; x<50; x=x+3)
{
out.print(x + " ");
}
Question 4
4.
for(int m=37; m>0; m=m-4)
{
out.print(m + " ");
}
Question 5
5.
int total=0;
for(int s=1; s<19; s++)
{
total=total+s;
}
out.println(total);