Predict the Output What will each of the following program segments display? 39. int myPowerFunction (int num, int power) { answer = 1; for (int count = 1; count <= power; count++) answer = answer num; %3D return answer; A) cout << myPowerFunction(2, 3) << endl; B) cout << myPowerFunction (3, 2) < end%; C) cout << myPowerFunction(2.5, 2) << endl;

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8RQ
icon
Related questions
Question

Urgent Answer plzz

Predict the Output
Yhat will each of the following program segments display?
39. int myPowerFunction (int num, int power)
{ answer = 1;
for (int count = 1; count <= power; count++)
answer = answer * num;
%3!
%3!
return answer;
}
A) cout << myPowerFunction (2, 3) << end%;
B) cout << myPowerFunction (3, 2) << endl;
C) cout << myPowerFunction (2.5, 2) << endl;
Transcribed Image Text:Predict the Output Yhat will each of the following program segments display? 39. int myPowerFunction (int num, int power) { answer = 1; for (int count = 1; count <= power; count++) answer = answer * num; %3! %3! return answer; } A) cout << myPowerFunction (2, 3) << end%; B) cout << myPowerFunction (3, 2) << endl; C) cout << myPowerFunction (2.5, 2) << endl;
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Study of Characters
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,