Evaluate the following expressions in java (show the steps), if the values of the variable are: a = 2, b = 3, and c = 9 i) - -c+ ++c+ a++ +(b++); ii) b+=b++ * c--% ++c/a++;
Answers
Answered by
2
import java.util.*;
public class x
{
public static void main (String args[])
{
int a = 2 , b = 3 , c = 9;
int i = --c + ++c + a++ + (b++);
int ii = b+=b++ * c-- % ++c/a++;
System.out.println(i);
System.out.println(ii);
}
}
OUTPUT :
22
4
Attachments:
Similar questions