Computer Science, asked by tasmiyahfatima38, 7 months ago

Rewrite The following using temary operator :if (in come<=10000) .tax=0, else tax=(.l0000)​

Answers

Answered by imtiyazallam
0

Answer:

tax = (income<=10000)? 0 : 10000;

Answered by anindyaadhikari13
1

\star\:\:\:\sf\large\underline\blue{Question:-}

  • Rewrite the following using ternary operator.

\star\:\:\:\sf\large\underline\blue{Answer:-}

Given code,

if(income <=10000)

tax = 0;

else

tax = 10000;

The above code can be written using ternary operator as,

tax=(income<=10000)?0:10000;

Similar questions