Revision - Decision Making
Revision - Decision Making
Worksheet 2
I. Evaluate the following expressions and write the output:
a) int p=12, q=10;
p+=((p+q)%10==0)?p++ + q++ : p-- - q--;
System.out.println ("p= "+p+"\nq= "+q);
b) int a=5,b=3;
if (++b>--a)
System.out.println(a++ + ++b);
else
System.out.println (a++ + --b);