Advertisement
RAJIBRAJU

ARRAY SUM

Jun 18th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int i,arr[100],n,sum=0;
  5.     scanf("%d",&n);
  6.     for(i=0; i<n; i++)
  7.     {
  8.         scanf("%d",&arr[i]);
  9.     }
  10.     for(i=0; i<n; i++)
  11.     {
  12. sum=sum+arr[i];
  13.         printf("%d",sum);
  14.     }
  15.  
  16.  
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement