Computer Science, asked by HimanshuGundapalli, 3 days ago

Rewrite the following using Ternary operator: if (a>0) System.out.println("A”); else System.out.println("+B"); (a=0) ? System.out.print("A") : System.out.print("B"); a>o ? System.out.println("A') : System.out.println("B"); (a-0) ? System.out.println("A"): System.out.println("B"); O None of these​

Answers

Answered by Aayush7RUBY
1

Answer:

Rewrite the following using ternary operator:

if(income < 10000)

   tax = 0;

else

   tax = 12;public class PredictOutput2

{

 public static void main(String args[])

 {

      int a = 6, b = 2, c = 3;

      System.out.println("Output 1: " + (a == b * c));  

      System.out.println("Output 2: " + (a == (b * c)));

 }

}

Explanation:

Similar questions