• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu

Q&A Discussions

When I enter two numbers the sum comes.. but when I input character as yes not y... Then it goes into an infinite loop... can anyone explain why? int a,b; char ch; do { cout<<"Enter two numbers: "; cin>>a>>b; cout<<"The sum is "<<a+b <<"\nDo you want to try again (y/n): "; cin>>ch; }while(ch=='Y'||ch=='y');
c++
0 Votes
2 Answers
10th Oct 2016, 1:14 PM
Soutik
Soutik - avatar
< Previous1...67Next >
Hot today
generic programming understanding memory ownership
0 Votes
overloading operators << >>
1 Votes
Default constructor and default assignment operator
0 Votes
Wishkit alternative for android
1 Votes
Hi
0 Votes
Issue in code
0 Votes
how does this code function?
0 Votes
My question is about python?
0 Votes
.
0 Votes
i need to learn Coding
0 Votes