Computer Applications

double c;
int x,y,z;
x=5; y=10; z=11;
c=x*y+z/2;
The value stored in c is:

  1. 55.0
  2. 55.5
  3. 55
  4. none

Java Operators

28 Likes

Answer

55.0

Reason — Putting the values of variables in the expression:
c = x * y + z / 2
c = 5 * 10 + 11 / 2
c = 50 + 5
c = 55.0 [∵ c is of double type, hence its value will be 55.0 not 55]

Answered By

7 Likes


Related Questions