Dyskusje Q&A
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 głosów
4 odpowiedziWhy it isn't working?
0 głosów
1 OdpowiedźMatrix I need help java
0 głosów
2 odpowiedziWrite a python program which will ask user to enter 3 numbers. Your program will output the sum and average of these 3numbers.your program will also output the largest number, the smallest number of these three. For exampleif user enter 2,10,3 than your program will output,
For number 2,10,3 sum is 15,average is 5,the largest number is 10 and the smallest number is 2.
-1 Głos
4 odpowiedziWhen 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 głosów
2 odpowiedziC++ for loop+break question
2 głosów
2 odpowiedziPopularne dzisiaj
Countdown Test
1 Votes
diary
1 Votes
Could anyone fix this?
0 Votes
how do i create a code
0 Votes
Leecode?
2 Votes
Fitting
0 Votes
Module quiz not opening
1 Votes