Advertisement
zfhridoy47

array_problem_3

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