Обсуждения
When I enter two numbers the sum is displayed.. 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');
0 голосов
4 ответовАктуальное сегодня
Seeking knowledge
1 Votes
What about... "Brainfuck"?
0 Votes
<nav>
0 Votes
Javascript
0 Votes
No Numerals Code Coach
1 Votes
html,java,css
0 Votes
Help in mini project
0 Votes