Computer Science, asked by Rockstar098, 8 months ago

Evaluate the following Java expression where a=10, b=2, c are integers numbers. c=a-(b++)*(--a)

Answers

Answered by krupalchalla
0

Answer:

Explanation:

Well, its 22. Try it yourself before down voting this answer. From first term of the expression

b=a++ + ++a;

a++ means 10 but it will increase it value if it is use again.

++a means increase value of a immediately. What is value of a. It is 10, no it will change it value by 1 if it use again. So from above line its value is 11 and than increase value of a immediately its value is 12.

So value of b = 22.

Use this below code

public class Program

{

   public static void main(String[] args) {

       int a=10,b;

       b= a++ + ++a;

       System.out.println(b);

Similar questions