nerdexam
CompTIA

FC0-U71 · Question #69

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?

The correct answer is B. Seven. 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. Fo

Software Development Concepts

Question

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?

Options

  • AFive
  • BSeven
  • CEleven
  • DTwelve

How the community answered

(32 responses)
  • A
    6% (2)
  • B
    81% (26)
  • C
    9% (3)
  • D
    3% (1)

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

Topics

#Pseudocode Interpretation#While Loops#Program Control Flow#Iteration Counting

Community Discussion

No community discussion yet for this question.

Full FC0-U71 Practice