Computer Science, asked by 70067958, 6 months ago

Write a function power() to raise a number m to a power n. The function takes a double value for m and int value for n and returns the result correctly. Use a default value of 2 for n to make the function to calculate squares when this argument is omitted. Write a main that gets the values of m and n from the user to test the function.
Ans:-

Pseudocode:
power(m,n)
begin
p=1
for i=0 to n by 1
do
p=p*m
end for
return(p)
end
Output:
CHOICES
1) Only Value of M
2) Value for both M and N

ENTER YOUR CHOICE:-1
Enter Value for M:-2.5
Power function when default argument is used =6.25
ENTER YOUR CHOICE:-2
Enter Value for M and N:-2.5 3
Power function when actual argument is use =15.625

Answers

Answered by kumarimamta57900
0

Answer:

jfkdndbhdjdkdlsslalan snacks ss

Answered by namratasingh8888
0

Answer:

sorry I don't know the answer of it and please mark me as brainlist and follow me

Explanation:

I hope you get the answer of it

Similar questions