Page 1 of 1

given the java program, What are the final values of a, b, and c? What is the output of the program? int a=8, b=3, c= 4;

Posted: Fri May 20, 2022 12:28 pm
by answerhappygod
given the java program, What are the final values of a, b, and
c? What is the output of the program?
int a=8, b=3, c= 4;
if (a>b)
if (a !=1)
a=a+b;
else a=a-b;
else
a=++a;
System.out.println(“a=”+a);