Home C Sum of two arrays in C programming Sum of two arrays in C programming / August 03, 2017 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