You usually put function prototypes outside of main (at the beginning of the file, after all include's).
void extend(float , float , float);
And if you pass an array as a parameter it's more flexible to add an additional parameter for the size of the array and then you use it instead of the hardcoded size:
I prefer to match the prototype with the actual definition hence I've added the parameter names.
void extern(float price, float quantity, float amount, int size);
You know that you are only processing 9 numbers? :-)
printf("this program will accept 10 numbers and the quantity\n");
I'm not sure if you already know about the preprocessor but if you use magic numbers in your code you should define them at the beginning of the file. Then there is only one place to change them:
#define SIZE 10
... // later in the program you use it everywhere you would have used the hardcoded value
for (i = 0; i < SIZE; i++)
Since both for-loops have the same range you could merge them into one.
for(j = 0; j < 9; j++)
amount[j] = price[j] * quantity[j];
for(h = 0; h < 9;h++)
Looks fine for me.
Originally Posted by chumpp