From bd1f146c6ca46f0cfa151aa73c499fb374a72fec Mon Sep 17 00:00:00 2001 From: TUNMAY 53 <71981903+TANMMAY24@users.noreply.github.com> Date: Sun, 30 Oct 2022 21:56:42 +0530 Subject: [PATCH] adding two array in c++ The above code adds two array in c++ --- adding two array in array | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 adding two array in array diff --git a/adding two array in array b/adding two array in array new file mode 100644 index 0000000..884ed64 --- /dev/null +++ b/adding two array in array @@ -0,0 +1,27 @@ +#include +using namespace std; +int main() +{ + int first[20], second[20], sum[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 the arrays:" << endl; + + for (c = 0; c < n; c++) { + sum[c] = first[c] + second[c]; + cout << sum[c] << endl; + } + return 0; +}