Advertisements
Advertisements
Question
Given p = 6.9;
Data type of p can be
Options
int
float
long
short
MCQ
Advertisements
Solution
float
Explanation:
- The value p = 6.9 contains a decimal point, so it requires a floating-point data type.
- A float is used to store decimal values, while int, long, and short store only whole numbers.
shaalaa.com
Is there an error in this question or solution?
Chapter 1: Revision of Class 9 Syllabus - Exercises [Page 42]
