fork download
  1. #include <stdio.h>
  2.  
  3. int a[]={1,2,3};
  4. int b[]={4,5,6};
  5. int c[3];
  6.  
  7. void add(int *a,int *b,int *c,int n){
  8. for(int i=0;i<n;i++){
  9. c[i]=a[i]+b[i];
  10. printf("%d\n",c[i]);
  11. }
  12. }
  13.  
  14. int main(void) {
  15. int n=3;
  16. add(a,b,c,n);
  17. // your code goes here
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
5
7
9