Courses
Log inStart Learning AI
Courses
Log inStart Learning AI

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...34Next >
Hot today
Audio adding
1 Votes
C#
0 Votes
What is problem in this code
0 Votes
playground input
0 Votes
Stuck in Quize
1 Votes
C Program
0 Votes
This Program Does Something Weird. Can You Explain Why?
1 Votes
Software developer
0 Votes
Asking for final year project ideas!
1 Votes
How does JavaScript's event loop handle asynchronous operations like setTimeout, Promises, and async/await, and what are the dif
1 Votes