What is the output of the following program: int r, a=50, b=10; r=(a>45) ?a : b; System.out.print(r);
Answers
Answered by
5
Question:-
- Write the output of the following code snippet.
Steps:-
Given code,
a=50
b=10
r=(a>45)?a:b;
System.out.print(r);
Now,
a>45 is true.
therefore,
r=a
Or,
r=50
Therefore, 50 is printed.
Output:-
50
Answered by
1
Input:-
a=50, b=10;
r=(a>45)?a:b;
System.out.println(r);
Output:-
r > 45
True.
Similar questions