Question #698

Assume the variable below are declared and initialized as shown:
int n,m;
double x,y;
n=23; m=5; x=2.3; y=4.5
what is the value of each expression below?
1. n/m 2. n%m 3. 25%m 4. m/n 5. n-x * 2 6. y-x+m 7. (double)n/m

Expert's answer

n/m: 4

n%m: 3

25%m: 0

m/n: 0

n-x: 20.7

y-x+m: 7.2

(double)n/m: 4.6

n%m: 3

25%m: 0

m/n: 0

n-x: 20.7

y-x+m: 7.2

(double)n/m: 4.6

## Comments

## Leave a comment