- What will be printed by the "print count" statement which comes after the EndWhile statement:
3
4
5
2
- How many times will the "print count" statement be executed inside the loop:
3
4
5
2
- How many times will the "While count <= 3" statement be executed:
3
4
5
2
Answer questions 4 and 5 for the pseudocode below:
For (index = 1, index < 14, index = index + 3)
print index
endFor
- How many times will the "print index" statement be executed:
5
4
6
3
- What will be the value of index for the second iteration:
5
4
6
3
- One wants to print even numbers between 14 and 20. Which for loop will accomplish this:
For (i = 12, i < 20, i = i + 2)
For (i = 14, i < 20, i = i + 2)
For (i = 14, i <= 20, i = i + 2)
For (i = 14, i < 23, i = i + 2)
- What will be printed for the following code?
product = 1
For (i = 1, i <=3, i = i + 1
product = product * i
endFor
print product
3
5
6
4
- What values of sales will stop the while loop shown below:
While (sales > 0)
print sales
get sales
endWhile
0
All numbers less than 0
All numbers less than or equal to 0
47
- Is there anything wrong with the loop shown below assuming sales to be 10000:
While (sales > 0)
print sales
endWhile
Nothing is wrong
Loop will run forever
- What will be printed for the code shown below:
sum = 0
For (i = 1, i <= 4, i = i + 1)
sum = sum + 1
endFor
print sum
15
5
6
10