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
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
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