You are viewing a single comment's thread. Return to all comments →
int n;
scanf("%d",&n); n++; int* arr=(int*)malloc(n * sizeof(int)); arr[0]=0; for(int i=1; i<n; i++){ scanf("%d",arr+i); arr[0]+=arr[i]; if(i==n-1) printf("%d",arr[0]); } free(arr);
Seems like cookies are disabled on this browser, please enable them to open this website
1D Arrays in C
You are viewing a single comment's thread. Return to all comments →
int n;