Expression Evaluation in Java
☰Fullscreen
Table of Content:
- Question 1: What is the result stored in x, after evaluating the following expression?
Given:
int x = 5;
Expression:
x++ * 2 + 3 * --x;
- Question 2:
Write an expression in Java for:
z = (5x^3 + 2y)/(x + y)
- Question 3: What will be the result stored in x after evaluating the following expression?
int x = 4; x += (x++) + (++x) + x; - Question 4: Give the output of the following method:
public static void main (String [] args){ int a = 5; a++; System.out.println(a); a -= (a--) - (--a); System.out.println(a);} - Question 5:
Write the Java expressions for:
- Question 6: If int y = 10 then find int z = (++y * (y++ + 5));
- Question 7: Write down java expression for:
- Question 8:
Give the output of the following expression:
a+= a++ + ++a + --a + a-- ; when a = 7
- Question 9: Write a Java expression for the following:
- Question 10: What is the value of x1 if x=5?
x1= ++x – x++ + --x - Question 11:
(h) Evaluate the following expression if the value of x=2, y=3 and z=1.
v=x + --z + y++ + y
- Question 12: Write a Java expression for the following:
- Question 13:
What is the value of y after evaluating the expression given below?
y+= ++y + y-- + --y; when int y=8
Related Questions
No Program Data.