Обсуждения
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 ответовhonestly, i have never dealt with any prog language before...i'm 22(aged enough to be confused, huh!)...trust me guys, i'm trying to know where exactly should i start to, things seem to be tough and above my head...u can tell me which way u hav passed up to now..i'll appreciate, thanks( if u wanna ask me, welcome)
0 голосов
4 ответовI have 10 variables called, int1, int2, int 3 and so on. The user can write one number into the console. If the user types 7, I want to add 3 to the value of int7. how do I do this without 10 if statements? can I somehow do something like, (int + "userinput") += 3?
thank you for your help! :D
0 голосов
2 ответовАктуальное сегодня
Ejercicio Pytho
0 Votes
What is that z for
0 Votes
Suggestions needed
4 Votes
Please rate my code from 1 to 10
2 Votes
How to start
0 Votes
Recursion doubt
2 Votes