Concept explainers
// This
#include <iostream>
using namespace std;
int main()
{
int choice, num1, num2;
do
{
cout ≪ "Enter a number: ";
cin ≫ num1;
cout ≪ "Enter another number:
cin ≫ num2;
cout ≪ "Their sum is " ≪ (num1 + num2) ≪ endl ;
cout ≪ "Do you want to do this again?\n";
cout ≪ "1 = yes, 0 = no\n";
cin ≫ choice;
} while (choice = 1)
return 0;
}
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
Starting Out with C++ from Control Structures to Objects, Student Value Edition (9th Edition)
Additional Engineering Textbook Solutions
Starting Out with C++: Early Objects (9th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Concepts Of Programming Languages
Degarmo's Materials And Processes In Manufacturing
SURVEY OF OPERATING SYSTEMS
Web Development and Design Foundations with HTML5 (8th Edition)