Advertisement
sujonshekh

Addition

Jan 23rd, 2017
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include<stdio.h>
  2. void printline();
  3. void Addition(int c[], int n);
  4.  
  5. int main()
  6. {
  7.     int a[]={4,2,6,-7,10};
  8.     Addition(a,5);
  9.  
  10. }
  11. void Addition(int c[], int n)
  12. {
  13. int i, s=0;
  14. for(i=0;i<n;i++)
  15. s=s+c[i];
  16. printline();
  17. printf("%d",s);
  18. printline();
  19. }
  20. void printline()
  21. {
  22.     printf("\n+++++++\n");
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement