Solved

Convert the Following If/else Statement to One That Uses the Conditional

Question 27

Essay

Convert the following if/else statement to one that uses the conditional operator:
if ( a % 2 == 0 )
System.out.println( "The number is even" );
else
System.out.println( "The number is odd" );

Correct Answer:

verifed

Verified

System.out.println( ...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions