Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int arr[10], size, i, sum = 0;
- printf("Enter array size\n");
- scanf("%d",&size);
- printf("Enter array elements\n");
- for(i = 0; i < size; i++)
- scanf("%d",&arr[i]);
- for(i = 0; i < size; i++)
- sum = sum + arr[i];
- printf("Sum of the array = %d\n",sum);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement