English

Given p = 6.9; Data type of p can be

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]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 1 Revision of Class 9 Syllabus
Exercises | Q 1. (xi) | Page 42
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×