Bird
0
0

Which of the following is the correct syntax to display the number 123 in PowerShell?

easy📝 Syntax Q12 of 15
PowerShell - Basics and Environment
Which of the following is the correct syntax to display the number 123 in PowerShell?
AWrite-Output "123"
BWrite-Output 123
CWrite-Output (123)
DWrite-Output [123]
Step-by-Step Solution
Solution:
  1. Step 1: Check syntax for Write-Output with numbers

    Write-Output can print numbers directly without quotes or brackets.
  2. Step 2: Evaluate each option

    Write-Output 123 uses Write-Output 123 which is correct syntax to print number 123.
  3. Final Answer:

    Write-Output 123 -> Option B
  4. Quick Check:

    Number without quotes prints correctly = B [OK]
Quick Trick: Numbers print without quotes in Write-Output [OK]
Common Mistakes:
  • Putting numbers inside brackets or square brackets
  • Using quotes unnecessarily for numbers
  • Confusing parentheses as required syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes