My code doesn't seem to run the function it calls. Please help.
This code takes a value from arr_values and multiplies it by 10 raised to the power in the corresponding position of arr_powers. The code is free from errors and warnings, but it doesn't display the correct values. Please correct me when you see the error. #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <math.h> double scale(double x, int n); int main(){ double arr_values[] = { 1.0, 2.0, 3.0, 4.0 }; int arr_powers[] = { 4, 3, 2, -2 }; double x; int i, n; for (i = 0; i < 4; i++) { x = arr_values[i]; n = arr_powers[i]; scale(x, n); printf("%.2lf ", arr_values[i]); } return 0; } double scale(double x, int n) { double scale_factor; scale_factor = pow(10, n); return x * scale_factor; }