Bird
0
0

What is the default data type of a number like 3.14 in PowerShell?

easy📝 Conceptual Q2 of 15
PowerShell - Variables and Data Types
What is the default data type of a number like 3.14 in PowerShell?
A[double]
B[float]
C[decimal]
D[int]
Step-by-Step Solution
Solution:
  1. Step 1: Identify default floating-point type in PowerShell

    PowerShell treats decimal numbers with decimals as [double] by default.
  2. Step 2: Confirm the type for 3.14

    3.14 is a floating-point number and defaults to [double], not [float] or [decimal].
  3. Final Answer:

    [double] -> Option A
  4. Quick Check:

    Decimal literals default to [double] in PowerShell [OK]
Quick Trick: Decimal numbers default to [double] unless specified [OK]
Common Mistakes:
  • Assuming [float] is default
  • Using [int] for decimals
  • Confusing [decimal] with default type

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes