What is the output of the following code snippet?
Public class test04
{
Public static int pow(int base, int power)
{
Int result = 1;
For (int i = 0; i < power; i++)
{
Result = result * base;
}
Return result;
}
Public static void main(String[] args)
{
System.out.println(pow(pow(2, 2) , 2) ) ;
}
}
A) 4
B) 8
C) 16
D) 32
Correct Answer:
Verified
Q34: Which of the following is true about
Q35: Which of the following is not legal
Q36: The Math.ceil method in the Java standard
Q37: What are the values of x and
Q38: What are the values of num1 and
Q40: What can be used as an argument
Q41: What step should you take after implementing
Q42: Given the following code, what is the
Q43: What is incorrect in the following code
Q44: Given the following code, which argument(s) will
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents