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
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.
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.
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.
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.
This section is not available anymore. Please use the main Exam Page.FC0-U61 Exam Questions
Log in to ExamTopics
Sign in:
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.
XRAYtheGodsend
Highly Voted 4 years agolexxone
Most Recent 2 months, 2 weeks agoColonel23
10 months, 1 week agoR_inzler
1 year, 6 months agoyanis88
1 year, 8 months agoIdkhelpme
2 years, 2 months agoAmycert
2 years, 3 months agoSweety_Certified7
2 years, 7 months agoSweety_Certified7
2 years, 7 months ago[Removed]
3 years ago69
3 years, 2 months agochrislacina
3 years, 1 month agochan_chahal
3 years, 4 months agoCyberChic
3 years, 11 months ago