Computer Science, asked by H3LLHUNTER, 11 months ago

double result =Math. pow(" 345" .indexOf('5'),3);

what will be it's result. explain how to solve. ​

Answers

Answered by saiteja0555
31

Answer:

8.00000004

Explanation:

"345".indexOf('5')=2

5 is on 2 nd place of the string so it returns the 2

math.pow(2,3)=2**3=2^3=8 hence the data type is double so the output format will be in double

therefore double contains of 8 numbers after

if ur input contain space infront of 345 the answer will be 27.00000004

Answered by sayakgupta999
2

answer will be 8.004 because 345 is the index of the '5' and power is 3 and when we calculate this we will get 8.004 which you can round off further if neede

Similar questions