Question: Hello, please see the below code in C. I am trying to compile it and it won't compile correctly due to the return statement in
Hello, please see the below code in C. I am trying to compile it and it won't compile correctly due to the return statement in file 1. Without using the pow() function, can you please help me?
Thank you!!
File #1
#include
int pow_xy(int *xptr, int y) {
int result;
while (y != 0) {
result *= *xptr;
y--;
}
return result;
}
File #2
#include
void test_p4() { printf(" p4 "); int numbers[5]; init_array(numbers, 5, 2); int i; for (i=0; i<5; i++) printf("%d ", numbers[i]); printf(" "); }
int main() {
test_p4();
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
