0
Please help me debug this code
4 Respostas
+ 2
Have another look at if-statements:
if is
if(age<20)
not
if(age<20);
There mustn't be ; after the condition
+ 1
Ok thanks guys 🙏
0
[TO MAKE IT REPEAT THE INPUT PROCESS]
I would suggest you to put a "checkpoint" between the first cout and the cin (something like "start:" or "point:" or whatever you want to name it), then put "goto start;" (your choosen name) in the else statement. Long story short:
checkpointname:
//your code
goto checkpointname; //inside your else statement
It is OK for this code, however I suggest to avoid goto statements when not necessary (because of eventual issues with objects initialization and values stored in variables to reset)
0
For the if statement, I fully agree with Lisa