Computer Science, asked by Abhimanu12, 4 months ago

Rewrite the following snippet by using ternary operator instead of if-else statements.[2M)
if(sale>15000)
comm=sale*5/100;
else
comm=0;
[2M]​

Answers

Answered by yesiamin6
1

Answer:

comm=sale>15000?sale*5/100:comm=0;

Explanation:

HOPE IT HELPS YOU

DO FOLLOW FOR MORE ANSWERS

MARK AS BRAINLIEST

Answered by anindyaadhikari13
2

Question:-

  • Rewrite the following snippet using ternary operator.

Solution:-

This is the converted code snippet.

comm=(sale>15000)? sale*5/100.0:0;

Similar questions