IHYPRESS.NET
C
HOME | ASP | C | CSS | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
CSimple Functions ❯ Power Scaling Calculator
<05.11>
/* 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); }
Hergestellt in Deutschland / Made in Germany
Enter a real number > 4.3 Enter an integer > 2 Result of call to function scale is 430.00
COPYRIGHT © 2015-2024 IHYPRESS.NET. A DIVISION OF IHY PRESS. ALL RIGHTS RESERVED.