Sum of two arrays in C programming

Image result for c programming

Sum of two arrays in C programming
Code:
  #include<stdio.h>
int main(){
  int n,a[20],b[20],i,j;
  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&a[i]);
  for(j=0;j<n;j++)
    scanf("%d",&b[j]);
  for(i=0;i<n;i++)
    printf("%d ",a[i]+b[i]);
  return 0;
}

No comments