comp sci final practice Flashcards
for the given psewudo code sum/val problem
sum = 0 / sum = sum + val
given pseudocode – count problem which xxx and yy will blah blah
count = count + 1 / nothing
for the given pseudocode, which xxx and yyy will output the smallest non negative
val < min / min = val
which input for char c causes “Done” to be output next
No such value (error comparing c and ‘y’)
what is the output if the input is 3 2 1 0
6 6 6 6 6 6 6 (infinite loop)
which xxx and yyy will loop as long as the input is an integer less than 10
w < 100 / cin»_space; w
how many times will the loop iterate if the input is 105 107 99 103
2
a loop should sum all inputs, stopping when the input is 0. if the input is 2 4 6 0, sum shoiuld end with 12. what should xxx, yyy, and zzz be? choices are in the form XXX/ YYY/ ZZZ
sum = 0; currVal != 0/ sum = sum + currVal
how many times does the while loop execute for the given input values of -1 4 0 9?
1
what is the output int x = 18
18 6 2
which loop will iterate 100 times
for (int i = 0; i < 100; i++)
what is the output if the input is 3 2 4 5
245
what is the ending value of sum, if the input is 2 5 7 3
12
what is the output if the count is 4?
4321
what is the output?
int n;
for (n = 0; n < 10; n = n + 2) {
cout «_space;n + wtv
0 3 6 9