Computer Applications
Find the value of ++a * (a++ + 5) + 3 * --a
, if a = 12.
Java Operators
6 Likes
Answer
The given expression is evaluated as follows:
++a * (a++ + 5) + 3 * --a (a = 12)
⟹ 13 * (a++ + 5) + 3 * --a (a = 13)
⟹ 13 * (13 + 5) + 3 * --a (a = 14)
⟹ 13 * (13 + 5) + 3 * 13 (a = 13)
⟹ 13 * (18) + 3 * 13
⟹ 234 + 39
⟹ 273
Answered By
3 Likes
Related Questions
If
String x = "Computer"; String y = "Science";
What will the following return?
(a) System.out.print(x.substring(2,6));
(b) System.out.print(x.indexOf(x.charAt(5)));
Write the Java statement for the following mathematical expression :
x =
State the type of errors, if any in the following statements.
(a)
switch (x < 2)
(b)
int a = 100, b = 0; System.out.println (a / b);
What will be the output of the following code?
int num = 10; if (num < 20) System.out.print(num++); else System.out.print(--num);