write a program that allows the user to enter 10 elements for both arrays X and Y. Compute for the sum of the first elements entered and store it in array Z. Do the same for the succeeding set of elements. Display all elements contained in the 3 arrays.
1
Expert's answer
2013-01-16T12:09:18-0500
#include <iostream> #include <conio.h>
using namespace std;
int main() { int X[10]; int Y[10]; int Z[10];
for(int i=0;i<10;i++){ cout<<"Enter element "<<(i+1)<<"for array X :"; cin>>X[i]; cout<<"Enter element "<<(i+1)<<"for array Y :"; cin>>Y[i]; }
Comments
Leave a comment