हिंदी

Assume the following declarations: short a=12; int b=33; float x=2.3; double y=3.14; Which one of the following expressions will NOT be evaluated using double precision floating point?

Advertisements

प्रश्न

Assume the following declarations:

short a=12;
int b=33;
float x=2.3;
double y=3.14;

Which one of the following expressions will NOT be evaluated using double precision floating point?

विकल्प

  • a + x

  • 1.5 + 8.6

  • a + b

  • x/y

MCQ
Advertisements

उत्तर

a + b

Explanation:

Both a (short) and b (int) are integer data types. In Java, the short value is promoted to int, so the expression a + b is evaluated using integer arithmetic, not double-precision floating-point arithmetic.

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 6: Variables and Expressions - EXERCISE [पृष्ठ १३३]

APPEARS IN

धीरज मेहरोत्रा Computer Science [English] Class 12
अध्याय 6 Variables and Expressions
EXERCISE | Q 49. | पृष्ठ १३३
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×