Computer Applications
Rewrite the following using ternary operator.
if(income<=100000)
tax = 0;
else
tax = (0.1*income);
Java Operators
160 Likes
Answer
tax = income <= 100000 ? 0 : (0.1*income);
Answered By
97 Likes
Related Questions
If a = 5, b = 9, calculate the value of:
a += a++ - ++b + aGive the output of the program snippet.
int a = 10, b =12; if(a>=10) a++; else ++b; System.out.println(" a = " + a + " and b = " +b);Rewrite the following using ternary operator.
if(p>5000) d = p*5/100; else d = 2*p/100;Write a program to find and display the value of the given expression:
(x + 3) / 6 - (2x + 5) / 3;
taking the value of x = 5