A C program to find addition of two array using fundtion

#include<stdio.h>
arraysum(int x[10],int z[10])
{
int i;
for(i=0;i<10;i++)
{
arraysum=x[i]+z[i];
}
return arraysum;
}

void main()
{
int i,a[10],b[10],c[10];
printf("enter the elements of 1st array");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
printf("enter the elements for second matrix");
for(i=0;i<10;i++)
{
scanf("%d",&b[i]);
}
for(i=0;i<10;i++)
{
c[i]=arraysum(a[i],b[i])
}
printf("the sum of array is");
for(i=0;i<10;i++)
{
printf("%d",c[i]);
}
getch();
clrscr();
}

Comments

Popular posts from this blog

Visti Cloud Service (VCS)

Being a DARK SKINNED is not a PROBLEM