scanf() should be tested against 0, not EOF.

Don't increment i until AFTER:
Code:
v[i]=price;
i++;
In addition, please tell the user how to use the program, and how to end the input. Keyboard input or redirection from a file?