Created
February 17, 2019 07:36
-
-
Save karellism/df88ff82028f436a573de65d4b590a71 to your computer and use it in GitHub Desktop.
Adding the Nth value of the first and second array and output their sum untill the limit is reached.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
main() | |
{ | |
int first[20], second[20], c, n; | |
cout << "Enter the number of elements in the array "; | |
cin >> n; | |
cout << "Enter elements of first array " << endl; | |
for ( c = 0 ; c < n ; c++ ) | |
cin >> first[c]; | |
cout << "Enter elements of second array " << endl; | |
for ( c = 0 ; c < n ; c++ ) | |
cin >> second[c]; | |
cout << "Sum of elements of two arrays " << endl; | |
for ( c = 0 ; c < n ; c++ ) | |
cout << first[c] + second[c] << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment