I am working on a program in c and I am trying to declare a ten element array, using a for loop to insert the elements. I am also using a second for loop to acquire the sum of all the elements in the array. I'm new to programming so I am curious where I am going wrong with this program.
1. #include <stdio.h>
2. void main()
3. {
4. int sum = 0;
5. int arayvalues[10];
6. int n = 0;
7. for (n = 0; n < 10; n = n + 1)
8. {
9. printf("Input an integer:");
10. scanf"("%d", &arayvalues);
11. }
12. int i = 0;
13. for(i = 0; i < 5; i = i + 1)
14. {
15. sum = sum + arayvalues;
16. }
17. printf("The sum is:", sum);
18. return;
19. }