+ 3

How???

How can i let a while() string(idk how its calles lol) run through it again i know break; ends it after smthing but how can i let the whole thing to it again?

3rd Nov 2019, 6:00 PM
Fabian G.
18 Respostas
+ 1
Remove both the break statements. But if you want the user to give 2 and print bye and then exit the code then leave the break statement as it is in the 2nd case.
3rd Nov 2019, 6:24 PM
Avinesh
Avinesh - avatar
+ 2
Put up a code for us to understand that question better.
3rd Nov 2019, 6:03 PM
Avinesh
Avinesh - avatar
+ 2
Your question is hard to understand.
5th Nov 2019, 1:47 PM
Sonic
Sonic - avatar
+ 1
Fabian what is that you exactly want to do?
3rd Nov 2019, 6:16 PM
Avinesh
Avinesh - avatar
+ 1
5th Nov 2019, 5:30 PM
Fabian G.
0
There break; ends it but how could i let the programm run it again after the user either used 1 or 2 and got and output like the programm asks if zhey want to run it again
3rd Nov 2019, 6:14 PM
Fabian G.
0
the user enters 1 as input the programm gives you Hello as output and then the programm is done and you would need to start it again to give an input again but i want the programm to ask the user if it wants to redo the whole programm again so the user could like give 2 as input to get Bye as output and i want to do that without starting the programm again
3rd Nov 2019, 6:19 PM
Fabian G.
0
its kinda hard to explain
3rd Nov 2019, 6:19 PM
Fabian G.
0
ill try it at my my programm at codevblocks ty
3rd Nov 2019, 6:25 PM
Fabian G.
0
Fabian It works that is why im letting you know.
3rd Nov 2019, 6:26 PM
Avinesh
Avinesh - avatar
0
ok tysm
3rd Nov 2019, 6:27 PM
Fabian G.
0
can ya maybe upvote my question and my programm for the badge 😁
3rd Nov 2019, 6:30 PM
Fabian G.
0
Fabian sorry code isn't worth it. But upvoted your question though.
3rd Nov 2019, 6:33 PM
Avinesh
Avinesh - avatar
0
ty
3rd Nov 2019, 6:33 PM
Fabian G.
0
Maybe you can use while twice.
5th Nov 2019, 11:01 AM
cenqiulan
0
i found a faw but its stupid ill just leave the programm like it it cenqiulan
5th Nov 2019, 11:51 AM
Fabian G.
5th Nov 2019, 11:51 AM
Fabian G.