Question
Use the following pieces of code and write the msising statements (2) that create the input and output iterators for this program. cout < <
Use the following pieces of code and write the msising statements (2) that create the input and output iterators for this program.
cout << "Enter two integers: ";
//create istream_iterator for reading int values from cin - name of iterator is inputInt
MISSING STATEMENT 1 // PLEASE CODE THIS STATEMENT
int number1{*inputInt}; // read int from standard input
++inputInt; // move iterator to next input value
int number2{*intputInt}; // read int from standard input
// create ostream_iterator for writing int values to cout - name of iterator is outputInt
MISSING STATEMENT 2 // PLEASE CODE THIS STATEMENT
cout << "The sum is: ";
*outputInt = number1 + number2; //output result to cout
cout << endl;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started