Bird
0
0

What will be the result of running this script in PowerShell ISE?

medium📝 Command Output Q5 of 15
PowerShell - Basics and Environment
What will be the result of running this script in PowerShell ISE?
$a = 5
$b = 10
$a + $b
AError: Variable not defined
B510
C5 + 10
D15
Step-by-Step Solution
Solution:
  1. Step 1: Analyze variable assignments

    $a is assigned 5, $b is assigned 10 as integers.
  2. Step 2: Evaluate the expression $a + $b

    Adding 5 and 10 results in 15, which is output to the console.
  3. Final Answer:

    15 -> Option D
  4. Quick Check:

    Integer addition result = 15 [OK]
Quick Trick: Variables hold numbers; + adds them numerically [OK]
Common Mistakes:
  • Concatenating numbers as strings
  • Assuming variables are undefined
  • Expecting literal expression output

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes