+ 1

Getting out of a loop

I'm stuck in a infinite loop when I enter a character. how to break out? https://code.sololearn.com/cY89OzDZ1gJU/?ref=app

8th Jul 2018, 10:24 PM
DerpyCoco
DerpyCoco - avatar
3 Answers
+ 6
dont write return 0 but only return. else you can write the "break" command
8th Jul 2018, 11:35 PM
NoxFly
NoxFly - avatar
+ 1
You should check the integer "num", not the input stream "cin".
8th Jul 2018, 11:27 PM
HoĂ ng Nguyễn Văn
HoĂ ng Nguyễn Văn - avatar