Multiple choice technology

What will be the output of the below CmdLet? $i = 1 do {Write-Host $i; $i++} while ($i-le 5) {Write-Host $i; $i++}

  1. 1 2 3 4 5

  2. 1

  3. 5

  4. none of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The do-while loop executes the block at least once, then continues while the condition is true. Starting with $i=1, it prints 1, then increments to 2, continuing until $i reaches 6. The output is: 1, 2, 3, 4, 5 (each on a new line via Write-Host). The loop exits when $i becomes 6, which fails the condition $i-le 5.