19. Rewrite the program and convert ternary operator to if-else
statements.
discount=(amount>=1000) ? amount*5/100 :
(amount>=5000)?amount 10/100 : amount* 2/100;
Answers
Answered by
3
Answer:
The ternary operator, also known as the conditional operator, is used as shorthand for an if...else statement. A ternary operator is written with the syntax of a question mark ( ? ) followed by a colon ( : ), as demonstrated below. In the above statement, the condition is written first, followed by a
Explanation:
I give you answer now it is your duty to mark me as a brianliest please follow me on brainly
Similar questions