मराठी

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×