0% found this document useful (0 votes)
20 views1 page

10 A

The document contains C++ code to add elements of two arrays and store the sums in a third array.

Uploaded by

Shan Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views1 page

10 A

The document contains C++ code to add elements of two arrays and store the sums in a third array.

Uploaded by

Shan Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

#include<iostream>

using namespace std;


int main()
{
int a[3], b[3], sum[3];
int i =0;
cout << "Enter elements of first array" << endl;
for (i = 0; i <3 ; i++)
cin >> a[i];

cout << "Enter elements of second array" << endl;

for (i = 0; i < 3; i++)


cin >> b[i];

cout << "Sum of elements of the arrays:" << endl;

for (i = 0; i < 3; i++) {


sum[i] = a[i] + b[i];
cout << sum[i] << endl;
}
}

You might also like