Home / Questions / What is the value stored in variable res given below: double res = Math.pow ("345".indexOf('5'), 3);
Explanatory Question

What is the value stored in variable res given below:

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

👁 98 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

Value of res is 8.0
Index of '5' in "345" is 2. Math.pow(2, 3) means 23 which is equal to 8