πŸ“Š C Programming
Q. Which data type is suitable for storing a number like?
25.00002500025
  • (A) double
  • (B) int
  • (C) both int and double
  • (D) float
πŸ’¬ Discuss
βœ… Correct Answer: (A) double

Explanation:

The number 25.00002500025 has high precision (many decimal places). To store such numbers accurately, we need a floating-point data type.

Why "double" is the best choice?

  • float (32-bit) has only 6-7 decimal places of precision, which may lose accuracy for very precise numbers.
  • double (64-bit) provides about 15-16 decimal places of precision, making it more suitable for storing high-precision numbers like 25.00002500025.

Why Other Options Are Incorrect?

(B) int ❌

  • int can only store whole numbers (e.g., 25, but not 25.00002500025).

(C) both int and double ❌

  • int cannot store decimal values, so this option is incorrect.

(D) float ❌

  • float may lose precision for very small decimal values, so it is not ideal for such cases.

Final Answer:

βœ… (A) double is the best data type to store 25.00002500025 with high precision.

Explanation by: Mr. Dubey

The number 25.00002500025 has high precision (many decimal places). To store such numbers accurately, we need a floating-point data type.

Why "double" is the best choice?

  • float (32-bit) has only 6-7 decimal places of precision, which may lose accuracy for very precise numbers.
  • double (64-bit) provides about 15-16 decimal places of precision, making it more suitable for storing high-precision numbers like 25.00002500025.

Why Other Options Are Incorrect?

(B) int ❌

  • int can only store whole numbers (e.g., 25, but not 25.00002500025).

(C) both int and double ❌

  • int cannot store decimal values, so this option is incorrect.

(D) float ❌

  • float may lose precision for very small decimal values, so it is not ideal for such cases.

Final Answer:

βœ… (A) double is the best data type to store 25.00002500025 with high precision.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
278
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Akash Lawaniya
Publisher
πŸ“ˆ
97%
Success Rate