Operators in Java Worksheet 2
A. Write the following statement using if else condition:
1. x = (a+b num2) ? (num1+num2):(num1-num2);
3. marks = (total >= 91)? “A+” : “A”;
B. Write the following if else condition using ternary operator:
1. if(salary > 10000)
Position = “A”;
else
Position = “B”;
2. if(a>5 && b>5)
num = 1;
else
num = 0;
3. if(x+y != z)
System.out.println(“Not equal to”);
else
System.out.println(“Equal to”);
Answers
Answered by
0
Answer:
I want also
I want also
I want also
I want also
it is important question
nice question
Similar questions