I am new to C++ and have been trying to understand the function below, I need a step by step of what it is actually doing, its a function that takes a BASE and a power it works but wish to know how exactly it works. I can do base calculation off the top of my head but this is a little different.
#include<stdio.h>
int pw(int,int);
int main()
{
int x,n,ans;
printf("Enter the numbers:base and power\n");
scanf("%d%d",&x,&n);
ans=pw(x,n);
printf("The ans is: %d\n",ans);
return 0;
}
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-39395.pdf
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment