google.com, pub-8786015629279405, DIRECT, f08c47fec0942fa0 Write a Program to Sum of Two One Dimensional Array in C

Write a Program to Sum of Two One Dimensional Array in C

0





// Write a program to add two array in single dimensional in C.

#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],b[5],c[5],i;
clrscr();
printf("Enter the Value of Array A\n");
for(i=0;i<5;i++)
{
scanf("%d",&a[i]);
}
printf("Enter the Value of Array B\n");
for(i=0;i<5;i++)
{
scanf("%d",&b[i]);
}
for(i=0;i<5;i++)
{
c[i]=a[i]+b[i];
}
printf("The sum of Array A and B is--\n");
for(i=0;i<5;i++)
{
printf("%d\n",c[i]);
}
getch();

}


Output:


Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Thank you for your interest 😊

We will back shortly after reviewing...

Thank you for your interest 😊

We will back shortly after reviewing...

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
To Top