Friday, October 30, 2009

Product of float and integer 5[F]a

Write a function which receives a float and an int from main( ), finds the product of these two and returns the product which is printed through main( ).

void main()
{
float product(float,int);
float a,p;
int b;
printf("\nEnter the two values to find the product");
scanf("%f%d",&a,&b);

p=product(a,b);
printf("The product is %f",p);
}

float product(float i,int j)
{
float pr;
pr=i*j;
return(pr);
}

No comments:

Post a Comment