You are viewing a single comment's thread. Return to all comments →
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> int getsum(int n) { int a[1000],sum=0; for (int i=0;i<n;i++) { scanf("%d ",&a[i]); sum=sum+a[i]; } printf("%d",sum); return 0; } int main() { int n; scanf("%d",&n); getsum(n); }
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 →