int a = 5, b = 10, c = 16, d = 0;
What are the outputs after the following Java statements are executed?
(a) if ( d )
else
system.out.println( “true” ); system.out.println( “false” );
(b) if ( a != 5 || b = = 10 ) system.out.println( “true” );
else
system.out.println( “false” );
(c) if ( b <=a && c/d)
system.out.println( “true” );
else
(d) if (a > 5 || d) else
system.out.println( “false” );
system.out.println( “true” ); system.out.println( “false” );
(e) if ( a*d >= d++ )
system.out.println( “true” );
else
system.out.println( “false” );
(f) if (d/a < c*b )
system.out.println( “true” );
else
system.out.println( “false” );
a. false
b. true
c. false
d. false
e. true
f. true
Comments
Leave a comment