Bird
0
0

What will be the output of this PowerShell code?

medium📝 Command Output Q5 of 15
PowerShell - Operators
What will be the output of this PowerShell code?
$a = 7
$b = 2
$c = $a * $b + 3
Write-Output $c
A14
B17
C20
D10
Step-by-Step Solution
Solution:
  1. Step 1: Calculate multiplication first

    $a * $b = 7 * 2 = 14.
  2. Step 2: Add 3 to the multiplication result

    14 + 3 = 17.
  3. Final Answer:

    17 -> Option B
  4. Quick Check:

    Operator precedence: * before +, result = 17 [OK]
Quick Trick: Multiplication (*) happens before addition (+) [OK]
Common Mistakes:
  • Adding before multiplying
  • Using wrong operator precedence
  • Calculating 7 + 2 * 3

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes