/* The scale Function */
/* Multiplies its first argument by the power of 10 */
/* specified by its second argument */
#include <stdio.h>
#include <math.h>
double
scale(double x, int n)
{
double scale_factor;
scale_factor = pow(10, n);
return (x * scale_factor);
}
int
main(void)
{
double n1;
int n2;
/* Get values for num_1 and num_2 */
printf("Enter a real number > ");
scanf("%lf", &n1);
printf("Enter an integer > ");
scanf("%d", &n2);
/* Call scale and display result. */
printf("Result of call to function scale is %0.2lf\n", scale(n1, n2));
return (0);
}