Computer Applications
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);}
Related Questions
Evaluate the given expression when the value of a=2 and b=3
b*=a++ - ++b + ++a; System.out.println("a= "+a); System.out.println("b= "+b);A student executes the following code to increase the value of a variable ‘x’ by 2.
He has written the following statement, which is incorrect.
x = +2;What will be the correct statement?
A. x +=2;
B. x =2;
C. x = x +2;- Only A
- Only C
- All the three
- Both A and C
Rewrite the following program segment using logical operators:
if(x > 5) if(x > y) System.out.println(x + y);