EmbLogic's Blog

Program of Addition of Two array an Answer storing in Third Array

#include<stdio.h>
int main()
{
int a[100],b[100],c[100],i,n;
printf(“enter element of array :”);
scanf(“%d”,&n);
printf(“Enter element of A:\n”);
for(i=0;i<n;i++)
{
scanf(“%d”,&a[i]);
}
printf(“Enter element of A:\n”);
for(i=0;i<n;i++)
{
scanf(“%d”,&b[i]);
}
for(i=0;i<n;i++)
{
c[i]=a[i]+b[i];
}
for(i=0;i<n;i++)
{
printf(“a[%d] + b[%d]=c[%d]\n”,a[i],b[i],c[i]);
}

}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>