EmbLogic's Blog

sum of two arrays.

#include<stdio.h>

int main()
{
int i,a[5],b[5],c[5];
printf(“\nReading the 1st array\n”);
for (i=0;i<5;i++)
{
printf(“Enter the  value”);
scanf(“%d”,&a[i]);
}
printf(“\nReading the 2nd array\n”);
for (i=0;i<5;i++)
{
printf(“Enter the  value”);
scanf(“%d”,&b[i]);
}
printf(“\nThe output of addition of 2 array is\n”);
for(i=0;i<5;i++)
{
c[i]=a[i]+b[i];
printf(“\nthe sum of %d & %d is %d”,a[i],b[i],c[i]);
}
return 0;
}

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>