ExamGecko
Question list
Search
Search

Question 377 - FC0-U61 discussion

Report
Export

Given the following pseudocode:

arduino

Copy code

WHILE X < 12

print 'Counting'

X += 1

If X=7, which of the following is the number of times the message will be displayed?

A.

Five

Answers
A.

Five

B.

Seven

Answers
B.

Seven

C.

Eleven

Answers
C.

Eleven

D.

Twelve

Answers
D.

Twelve

Suggested answer: B

Explanation:

In the given pseudocode, the message 'Counting' is printed in a loop while X is less than 12. The variable X starts incrementing by 1 each time through the loop. If X starts at 0, the loop will run and display the message 7 times before X reaches 7.

The loop starts with X = 0.

For X values from 0 to 6, the message is printed, making a total of 7 times before X becomes 7 and the loop halts.

CompTIA IT Fundamentals (ITF+) Certification Pseudocode Concepts

Official CompTIA A+ Certification Guide

asked 06/10/2024
Matt Gifford
33 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first