Saturday, December 4, 2010

source code

#include<stdio.h>
#include<math.h>



double scale(double x, int n);

int main(void)
{
double num_1;
int num_2;

//get values for num_1 and num_2

printf("Enter a real number>");
scanf("%lf",&num_1);
printf("Enter an integer>");
scanf("%d",&num_2);
/*call scale and display result*/
printf("Result ofcall to function scale is %f\n",scale(num_1,num_2));
return (0);
//num_1 is called "actual argument"
//num_2 is called " actual arguent"
}

double scale(double x,int n)

{
//dkf
//dfkd
//x is formal parameter
//n is formal parameter
double scale_factor;
//local variable -10 to power n
scale_factor = pow(10,n);
return(x*scale_factor);
}


http://codepad.org/Gj2sasoY

online compiler

so easy and fast

it is better than other IDE or any other thing

No comments:

Post a Comment