scanf() should be tested against 0, not EOF.
Don't increment i until AFTER:
In addition, please tell the user how to use the program, and how to end the input. Keyboard input or redirection from a file?Code:v[i]=price; i++;
scanf() should be tested against 0, not EOF.
Don't increment i until AFTER:
In addition, please tell the user how to use the program, and how to end the input. Keyboard input or redirection from a file?Code:v[i]=price; i++;