if amount is greater than or equal to 15000 then the discount is 10% otherwise discount is 5%. Convert the statement into ternary operator.
Answers
Answered by
2
double a,b;
System.out.println(“Enter the amount”);
a=in.nextInt();
b=(a>=15000?5:10);
System.out.println(“The discount you got= “+b);
Thank you,
If you like the answer mark me as the brainliest....
System.out.println(“Enter the amount”);
a=in.nextInt();
b=(a>=15000?5:10);
System.out.println(“The discount you got= “+b);
Thank you,
If you like the answer mark me as the brainliest....
Similar questions