0
I am in doubt about an if statement in my code. Help.
Hello, I need help with my code. It's a simple thing, but I have a doubt in the if, else and the while loop statements, because it omits a sentence. https://code.sololearn.com/c7KMux0IcQ2k This is my code, the only fault is that the output does not appear on the screen: cout<<"\n If you want to repeat the operation, enter 0, if you want to exit, enter 1"<<endl; cin>>cent;, which is at the end of the "do while", I don't know if it's because of the location or what, but it doesn't print it, and I can't put it before because I don't want it to be part of the loop. I hope you can help me, thanks, good night.
5 ответов
+ 1
Again...🙄
Look at line 31: while (divi>=0)
Correct to: while (divi>0)
And read the reason of the error in my previous post
+ 5
Nelli Yunuen your program is working correctly and it give proper output which u want . Its a playground problem try in other compilr.
{
cout statement << "\n If you want to repeat the operation, enter 0, if you want to exit, enter 1" << endl; cin >> cent; I do not understand why it does not appear on the screen.
}
its showing properly
+ 1
while(div>=0) is not correct
if you let div going to 0 you will have a division by 0
https://code.sololearn.com/ceG0HS73cv28/?ref=app
All the input in SoloLearn must be on the same line, for example 6 0 2 1
+ 1
Sorry, I had not read well. Thank you.
0
I have already modified the variable, but the real problem is in the cout statement << "\n If you want to repeat the operation, enter 0, if you want to exit, enter 1" << endl; cin >> cent; I do not understand why it does not appear on the screen.