I am working on a program that will have the user input two numbers ....the program then adds them together and prints out the sum.....the program is to then ask if you want to continue...the user is to type in y or n....how do i go about having the program read in the characters and continue the loop
bricjames
0
Newbie Poster
Recommended Answers
Jump to PostHere's something to play with as a template:
#include <ios> #include <iostream> #include <limits> #include <string> using namespace std; int main() { bool done = false; do { int value; cout<<"Enter a number: "; if ( !( cin>> value ) ) break; cout<<"You entered "<< value <<'\n'; …
Jump to PostAre you required to use C headers/functions or are you allowed to use C++?
All 7 Replies
Narue
5,707
Bad Cop
Team Colleague
bricjames
0
Newbie Poster
Alex Edwards
321
Posting Shark
bricjames
0
Newbie Poster
VernonDozier
2,218
Posting Expert
Featured Poster
Narue
5,707
Bad Cop
Team Colleague
MelechM
1
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.