i need some direction on how to do this. i need to take the values in my two arrays and find the product of them and store that into my third array. This is what i have so far.
Code:
#include <stdio.h>
#include <conio.h>
int main()
{
void extend(float [9], float[9] , float[9]);
float price[9];
float quantity[9];
float amount[9];
int i;
printf("this program will accept 10 numbers and the quantity\n");
for(i = 0; i < 9; i++)
{
printf("Please enter the price:\n");
scanf("%f", &price[i]);
printf("Please enter the quantity:\n");
scanf("%f", &quantity[i]);
}
extend(price, quantity, amount);
getch();
return 0;
}
void extend(float price[], float quantity[], float amount[])
{
int j;
int h;
for(j = 0; j < 9; j++)
{
amount[j] = price[j] * quantity[j];
}
for(h = 0; h < 9;h++)
{
printf("%.2f\n", amount[h]);
}
}
for some reason i keep getting errors.