Skip to main content
5 events
when toggle format what by license comment
Jun 13, 2019 at 3:23 vote accept Kat
Jun 13, 2019 at 3:23 comment added Kat thank you, that helped a lot! I misunderstood it from the lecture. I thought "return" was necessary to ask for the input again, if the first input was not within the set conditions. I did not realize omitting "return" would have that effect anyway.
Jun 12, 2019 at 18:33 comment added Cliff B A return statement causes an immediate, unconditional termination of the current code and a "return" to the calling code. No further code will be executed! If a return statement is in a function, it causes an immediate return to the calling function or main. If a return statement is executed in main(), then the program terminates and control is returned to the operating system. In other words, the program ends.
Jun 12, 2019 at 18:10 comment added Kat Sorry, but I am not following what about the return statement terminates the program? I am a total beginner and tried for more than a week to resolve this, comparing it to the lecture examples. (I excluded the “less than 23” condition for now, in an attempt to pare it down to eliminate anything that could be going wrong) The return statement appears to work as it should, accepting positive height input, rejecting negative height input. Thank you for your help.
Jun 12, 2019 at 16:35 history answered Cliff B CC BY-SA 4.0