You are viewing a single comment's thread. Return to all comments →
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n; int temp; scanf("%d", &n); int* arrayno = (int*)malloc(n*sizeof(int)); for (int i=0; i<n; i++) { scanf("%d", &temp); arrayno[i] = temp; } temp = 0; for (int i=0; i<n; i++) { temp += arrayno[i]; } free(arrayno); printf("%d", temp); return 0;
}
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 main() {
}