(Nov-15-2020, 06:44 AM)KingKhan248 Wrote: If I use the else statement, wouldn't the program ask the user to input values even after a negative number was entered? If for len1 they entered -15 wouldn't the program then ask for len2 and len3, then at the end output the error message?Yes it will ask for all 3 and then it will check for negative values. @deanhystad showed you one possible approach how to check for negative number immidiatelly. One thing that he does not show is how to keep asking for input until you don't get valid input. But also in his case it will not terminate immediately. It will continue to collect rest values.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs