Bird
0
0

What will be the output of the following PowerShell code?

medium📝 Command Output Q13 of 15
PowerShell - Operators
What will be the output of the following PowerShell code?
$a = 10
$b = 3
$c = $a / $b
Write-Output $c
A3
B3.0
CError
D3.33333333333333
Step-by-Step Solution
Solution:
  1. Step 1: Understand division operator behavior

    In PowerShell, dividing integers returns a floating-point number with decimals.
  2. Step 2: Calculate 10 divided by 3

    10 / 3 equals approximately 3.33333333333333.
  3. Final Answer:

    3.33333333333333 -> Option D
  4. Quick Check:

    Division returns float result [OK]
Quick Trick: Division returns decimal numbers, not just integers [OK]
Common Mistakes:
  • Expecting integer 3 instead of decimal
  • Thinking division causes error
  • Confusing with integer division truncation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes