write a program to find the sum of two arrays.

#include<stdio.h>
#include<conio.h>
int main()
{
int a1[5],a2[5],a3[5],i;
printf("enter five value in first array\n");
for(i=0;i<5;i++)
{
scanf("%d",&a1[i]);
}
printf("enter five value in second array\n");
for(i=0;i<5;i++)
{
scanf("%d",&a2[i]);
}
for(i=0;i<5;i++)
{
a3[i]=a1[i]+a2[i];
}
printf("addition of two array\n");
for(i=0;i<5;i++)
{
printf("%d\n",a3[i]);
}
return 0;
}


Comments

Popular posts from this blog

write a program for insertion sort with example.