Write a program in java using Ternary operator that will add the values of two variables, if the first number is greater than the second number, Else it will subtract the values and display the output.
Answers
Answered by
2
Answer:
public class program{
public static void main ( String [ ] args){
int a = 7;
int b = 4;
if (a > b){
System.out.println(a + b);
}
else{
System.out.println(a - b);
}
}
}
HOPE THIS HELPS!
Similar questions