Computer Science, asked by amritmr, 9 months ago

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