Find the output for the following:
1. int a = 8, b = 6, c;
c = ++a * 4 + b++;
System.out.println(c);
2. int m = 3, n = 7, p;
p = (++m * n--)+ (++n/4);
System.out.println(p);
3. int x = 8, y = 6, z = 5, t;
t = ++y * x-- + --z * x--
System.out.println(c);
4. int p = 6; q = 9, r;
r = q + p++ * ++q – p;
System.out.println(r);
5. If p = 5 ; find d = ++p + 5;
6. If a = 48 ; find a = a++ + ++a;
7. If c = 2; find d = ++c + c++ + 4;
8. If int x = 8, y = 6, z = 5, find t = ++y * x-- + --z * x--
9. If y = 14; find z = (++y * (y++ + 5))
10. If a = 4, b = 3; find the value of c = a++ * 6 + ++b*5 + 10;
Answers
Answered by
2
1) c = 9*4+7 = 43
2) p = 4*7+8/4 =30
3) 6*8 +3*8 = 72
4) r = 9 + 7 * 10 =79
5) d = 6 + 5 = 11
6) a = 48 + 49 = 97
7) d = 3 + 2 + 4 = 9
8) t = 7*8 + 3*8 = 80
9) z = 19*15 = 285
10) c = 4*6 + 4*5 +10 = 54
Similar questions
Science,
1 month ago
Computer Science,
1 month ago
English,
3 months ago
Math,
3 months ago
Hindi,
9 months ago
Science,
9 months ago
India Languages,
9 months ago