Hey, I started getting into array and I'm writing this program but I don't know how to add the values in the array.The program looks something like this:
#include <stdio.h>
main()
{
/*declare variables*/
int array[10]
int x;
int num;
int sum;
/*prompt user for variable*/
printf("\nEnter ten values\n");
for (x=0;x<10;x++) {
printf("\nEnter %d number:",x+1);
scanf("%d",array[num]);
/*Here where my problem start*/
sum+=array[num]
/*Here where problem ends or atleast where I think it ends*/
printf("\nThe Sum is:%d",sum);
return(0);
}