0
double a=1000+((15/100)*1000)

i am trying to add 15 percent to 1000. instead of 1150.0 output is 1000.0

But when i tried

double a=1000+((15*1000)/100)

the output is 1150.0

CrazyCoder
  • 350,772
  • 137
  • 894
  • 800

0 Answers0