We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- C
- Arrays and Strings
- 1D Arrays in C
- Discussions
1D Arrays in C
1D Arrays in C
+ 0 comments include
include
include
include
int main() {
int i,n,sum=0; scanf("%d",&n); int a[n]; for(i=0;i<n;i++){ scanf("%d",&a[i]); sum=sum+a[i]; } printf("%d",sum); return 0;
}
+ 0 comments int main() { int n,sum=0; scanf("%d",&n); int ar[n]; for(int i=0;i<n;i++){ scanf("%d",&ar[i]); sum=sum+ar[i]; } printf("%d",sum); return 0; }
+ 0 comments include
include
include
include
int main() {
int numberofelementsinarray=0, sum=0; scanf("%d",&numberofelementsinarray); int arr = (int)malloc(numberofelementsinarray * sizeof(int)); for(int i=0; i return 0; }
+ 0 comments include
include
include
include
int main() { int n; scanf("%d",&n); int arr[n]; int sum=0; for(int i=0;i
+ 0 comments include
include
include
include
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n; scanf("%d",&n); int arr[n]; for(int i=0;i<n;i++){ scanf("%d ",&arr[i]); } int sum=0; for(int j=0;j<n;j++){ sum+=arr[j]; } printf("%d",sum); return 0;
}
Load more conversations
Sort 450 Discussions, By:
Please Login in order to post a comment