Bird
0
0

Which of the following is the correct syntax to store the number 10 in a variable named $score in PowerShell?

easy📝 Syntax Q3 of 15
PowerShell - Variables and Data Types
Which of the following is the correct syntax to store the number 10 in a variable named $score in PowerShell?
A$score := 10
Bscore == 10
C$score = 10
Dset $score 10
Step-by-Step Solution
Solution:
  1. Step 1: Recall PowerShell variable assignment syntax

    PowerShell uses $variable = value to assign data.
  2. Step 2: Check each option

    Only "$score = 10" uses correct syntax with $ and single equals sign.
  3. Final Answer:

    $score = 10 -> Option C
  4. Quick Check:

    Correct variable assignment syntax = $score = 10 [OK]
Quick Trick: Use $name = value to store data in PowerShell [OK]
Common Mistakes:
  • Using double equals for assignment
  • Using := which is not PowerShell syntax
  • Trying to use 'set' command

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes