What could expression1 and expression2 be, respectively, in order to produce output –8, 16?

Given the code fragment: What could expression1 and expression2 be, respectively, in
order to produce output –8, 16?

Given the code fragment: What could expression1 and expression2 be, respectively, in
order to produce output –8, 16?

A.
A + +, b – –

B.
+ +a, – -b

C.
+ +a, b- –

D.
A+ +, – – b



Leave a Reply 5

Your email address will not be published. Required fields are marked *


ARJIT GAUTAM

ARJIT GAUTAM

correct C is the answer.

obrain

obrain

C.
+ +a, b- –

Roger

Roger

int a = -10;
int b = 17;
int c = ++a;
int d = b–;
c++;
System.out.println(c);
d–;
System.out.println(“a: ” + c + ” b: ” + d);