PowerShell - Control Flow
Identify the error in this PowerShell
while loop code:$i = 5
while ($i -lt 5)
{
Write-Output $i
$i++
}
while loop code:$i = 5
while ($i -lt 5)
{
Write-Output $i
$i++
}
$i -lt 5 (less than 5). Since 5 is not less than 5, the condition is false initially.while loop body never runs, so no output is produced.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions