exam questions

Exam FC0-U61 All Questions

View all questions & answers for the FC0-U61 exam

Exam FC0-U61 topic 1 question 92 discussion

Actual exam question from CompTIA's FC0-U61
Question #: 92
Topic #: 1
[All FC0-U61 Questions]

Given the following pseudocode:

Which of the following is the output of the code?

  • A. 1
  • B. 9
  • C. 10
  • D. 11
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
XRAYtheGodsend
Highly Voted 4 years ago
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
upvoted 9 times
...
lexxone
Most Recent 2 months, 2 weeks ago
Selected Answer: C
C. 10 Explanation: Let's go step by step through the pseudocode: declare @count int: Declares a variable @count of type int. set @count = 1: Initializes @count with the value of 1. for @count < 10: This starts a loop that will run as long as @count is less than 10. However, there's an issue with the pseudocode: it uses a for loop without a proper structure, but we can assume it's meant to be a while loop. begin: Starts the block of code inside the loop. set @count = @count + 1: Increases the value of @count by 1 in each iteration of the loop. end: Ends the loop. select @count: Outputs the final value of @count.
upvoted 1 times
...
Colonel23
10 months, 1 week ago
The answer is C. It would not print out 11 because the condition is LESS THAN not LESS THAN EQUAL TO
upvoted 1 times
...
R_inzler
1 year, 6 months ago
Selected Answer: 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
upvoted 1 times
...
yanis88
1 year, 8 months ago
Selected Answer: C
Consider the following simple loop (python): count = 1 while count < 10: count += 1 print (count) that will print 10 in the console!
upvoted 1 times
...
Idkhelpme
2 years, 2 months ago
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.
upvoted 2 times
...
Amycert
2 years, 3 months ago
Selected Answer: C
C. 10 for count =9: count < 10 count = 9+1 = 10 for count =10: loop does not enter count value ends with 10
upvoted 2 times
...
Sweety_Certified7
2 years, 7 months ago
Selected Answer: D
@count=1. @count <10 @count= @count(1) + 10 So.. @count = 11
upvoted 1 times
Sweety_Certified7
2 years, 7 months ago
Sorry, third line is.. @count= @count(10)+1 Since it is set @count =1 for @count < 10
upvoted 1 times
...
...
[Removed]
3 years ago
Selected Answer: C
The loop is exited when count is 10
upvoted 3 times
...
69
3 years, 2 months ago
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.
upvoted 1 times
chrislacina
3 years, 1 month ago
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.
upvoted 1 times
...
...
chan_chahal
3 years, 4 months ago
yes, it should be 10.
upvoted 2 times
...
CyberChic
3 years, 11 months ago
I agree, it should be 10
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago