Exam FC0-U61 All QuestionsBrowse all questions from this exam
Question 73

Given the following pseudocode:

Which of the following is the output of the code?

    Correct Answer: C

    The pseudocode starts by setting the variable @count to 1. A loop then increments @count by 1 as long as @count is less than 10. When @count reaches 9, the loop executes one last time, increments it to 10, and then exits the loop because the condition @count < 10 is no longer true. Thus, the final value of @count is 10, making the output of the code 10.

Discussion
XRAYtheGodsendOption: C

Shouldn't this be ten? It says as Long as @count is LESS THAN 10, add 1. So when @count is equal to 10, It should stop. Because 10 is EQUAL TO 10. 10 is NOT LESS THAN 10

[Removed]Option: C

The loop is exited when count is 10

IdkhelpmeOption: C

It's suppose to be 10. It enters loop for the final time at 9. Which sets it to 10. It can't run the loop after that since 10 is not less than 10. So it returns 10.

AmycertOption: C

C. 10 for count =9: count < 10 count = 9+1 = 10 for count =10: loop does not enter count value ends with 10

chan_chahalOption: C

yes, it should be 10.

CyberChicOption: C

I agree, it should be 10

Colonel23Option: C

The answer is C. It would not print out 11 because the condition is LESS THAN not LESS THAN EQUAL TO

R_inzlerOption: C

C is the correct answer, the code only loops if @count is under 10, once its value is 10, it stops looping, meaning the final output is 10. or C

yanis88Option: C

Consider the following simple loop (python): count = 1 while count < 10: count += 1 print (count) that will print 10 in the console!

Sweety_Certified7Option: D

@count=1. @count <10 @count= @count(1) + 10 So.. @count = 11

Sweety_Certified7

Sorry, third line is.. @count= @count(10)+1 Since it is set @count =1 for @count < 10

69Option: D

I believe it is 11 because when we look at the pseudo code, it has the +1 after the <10. This means that one more numbers adds up to the current one, therefore, it comes out as 10.

chrislacina

The plus one might be after the check, but the loop checks that the variable is less than ten, not less-than-or-equal-to ten. so once the variable reaches nine, it would be nine plus one, equaling ten, and then its checked again, and then leave the loop.