English

Give reason whether the following assignment is correct or not. float f = 0.002654132; - Computer Applications

Advertisements
Advertisements

Question

Give reason whether the following assignment is correct or not.

float f = 0.002654132;

Answer in Brief

Solution

This assignment is incorrect since the data type for 0.002654132 is double, yet it is assigned to a float variable. The correct assignment will be float f = 0.002654132f;

shaalaa.com
  Is there an error in this question or solution?
Chapter 1.03: Values and Data Types - EXERCISES [Page 33]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 1.03 Values and Data Types
EXERCISES | Q III. 12. (b) | Page 33
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×