Convert the following code segment into its equivalent if else statement:
String max=(a%2==0)?"Even" : "Odd";
Answers
Answered by
3
Answer:
String max;
if (a%2==0)
max="Even";
else
max="Odd";
Answered by
2
Answer:-
Using if else, we can write like this.
String max;
if(a%2==0)
max="Even";
else
max="Odd";
Similar questions