Computer Science, asked by evasharma75200, 1 month ago

6 Rewrite the following
using ternary operater-
if (income<=1000000)
tax=0,
else
tax=(0.1* income);

Answers

Answered by BrainlyProgrammer
8

Corrected Question:-

  • Rewrite the following using ternary operater:-

if (income<=1000000)

tax=0;

else

tax=(0.1* income);

Answer:-

tax=(income<=1000000)?0:(0.1*income);

About ternary operator

  • Also known as Conditional Operator as the value assigned to it depends on the conditions.
Similar questions