What will be the output of the following program?
Correct Answer : A
In both the programs, an integer variable
marks is declared and initialized to
50. The first
if condition fails in both and control goes to second condition. In both the programs, second
if condition is satisfied. So the display statement prints Pass. Thus both the programs are same. As both programs execute same number of statements, their speed of execution is same.
Topic: if else if ladder In Java