Computer Applications
Rewrite the following using ternary operator.
if(p>5000)
d = p*5/100;
else
d = 2*p/100;
Related Questions
Give 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(income<=100000) tax = 0; else tax = (0.1*income);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
Write a program to find and display the value of the given expression:
a2 + b2 + c2 / abc;
taking the values a=5, b=4, c=3