64 686
Assignments Done
99,3%
Successfully Done
In September 2018

Answer to Question #42134 in C++ for Felicitas O

Question #42134
Write a program for the addition of 2 numbers and output the sum. the program should have 5 different set of values and display the result.
Expert's answer
#include <iostream>
using namespace std;
int main() {
const int SIZE = 5;
int number1[SIZE];
int number2[SIZE];
cout << "You will now be asked to enter 10 numbers. Please enter them as sets" << endl;
for ( int i = 0; i < SIZE; i++ ) {
  cout << "Please enter the first number of the set number " << i+1 << endl;
  cin >> number1[i];
  cout << "Please enter the second number" << endl;
  cin >> number2[i];
}
for ( int i = 0; i < SIZE; i++ ) {
  cout << "Sum of the set number " << i+1 << " is " << number1[i] + number2[i] << endl;
}
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions