Bird
0
0

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

easy📝 Syntax Q3 of 15
PowerShell - Basics and Environment
Which of the following is the correct syntax to display the number 10 in PowerShell?
AWrite-Output 10
BWrite-Output "10"
CWrite-Output (10)
DAll of the above
Step-by-Step Solution
Solution:
  1. Step 1: Check each option's validity

    Write-Output 10 outputs number 10 directly. Write-Output "10" outputs string "10" which also displays 10. Write-Output (10) uses parentheses which is valid syntax.
  2. Step 2: Confirm all produce output 10

    All options display 10 on the console correctly.
  3. Final Answer:

    All of the above -> Option D
  4. Quick Check:

    All syntaxes display 10 correctly [OK]
Quick Trick: Numbers can be output as numbers or strings [OK]
Common Mistakes:
  • Thinking only one syntax works
  • Confusing parentheses usage

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes