Predict the output:Int a=7,b=9;Int cra>b? ata:b*b;System.out.println(c) *
Answers
Answered by
0
Answer:
I think there are some typos in your question, instead, it should be :
Predict the output: int a = 7, b = 9; int c = a > b ? a * a : b * b; System.output.println(c);
Output: 81
Explanation:
Here we are comparing variable 'a' to 'b', if 'a' > 'b' then 'a' * 'a' else 'b' * 'b'.
Since a = 7 and b = 9,
- 9 > 7 then we will multiply 9 * 9, we will get '81'.
- Print '81' to the console.
Similar questions