KnowledgeBoat Logo
|

Computer Applications

If int n[] = {1, 2, 3, 5, 7, 9, 13, 16}, what are the values of x and y?

      x = Math.pow(n[4], n[2]);
      y = Math.sqrt(n[5] + n[7]);

Java Arrays

ICSE 2013

61 Likes

Answer

    x = Math.pow(n[4], n[2]);
⇒ x = Math.pow(7, 3);
⇒ x = 343.0;

    y = Math.sqrt(n[5] + n[7]);
⇒ y = Math.sqrt(9 + 16);
⇒ y = Math.sqrt(25);
⇒ y = 5.0;

Answered By

36 Likes


Related Questions