Sesiones de PyR
Test the code
0 Votos
2 RespuestasWhen 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 Votos
4 RespuestasThe code shown below in the description runs here when I try it, but when I wrote it on code blocks it gave me 5 errors..
1. expected imitializer before '<' token. (line 19).
2. reference to 'pair' is ambiguous. (line 26).
3. expected primary-expression before double. (line 26).
4. expected ';' before 'double'. (line 26).
5. 'obj' was not declared in this scope. (line 27).
Any help please?
0 Votos
5 Respuestasc# try-catch vs trypharse
0 Votos
1 RespuestaWhen 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');
0 Votos
2 RespuestasEn tendencia hoy
Help please?
3 Votes
Ejercicio Pytho
0 Votes
Online voting system
2 Votes
What is that z for
0 Votes
Suggestions needed
4 Votes
SQL practice
2 Votes
Game development
0 Votes