write a program in c to add two arrays?
Answers
Answered by
1
#include <stdio.h>
int main()
{
int m, n, c, d, first[10][10], second[10][10], sum[10][10];
printf("Enter the number of rows and columns of matrix\n");
scanf("%d%d", &m, &n);
printf("Enter the elements of first matrix\n");
for (c = 0; c < m; c++)
Answered by
0
Answer:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[10],b[10],i, j;
//input for first array
for(i=0;i<10;i++)
{
cout<<"\nEnter any number:";
cin>>a[i];
}
//input for second array
for(j=0;j<10;j++)
{
cout<<"\nEnter any number:";
cin>>b[j];
}
//show add of first and second array
for(i=0;i<10;i++)
{
cout<<a[i]+b[i]<<endl;
}
getch();
}
Similar questions