Please help me it's duo today and I don't understand what I'm doing wrong, there's this weird 'bash: command not found' error.
Please help me it's duo today and I don't understand what I'm doing wrong, there's this weird 'bash: command not found' error.
Because your number is uninitialised, the while loop was initially false and the program just ends with no output.
You typed 9999 at a new prompt, not in your program.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Get rid of the spaces around the %i.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Thanks it worked!! but now it keeps printing it endlessly, how do I restrict that to print the contents of the while loop only once? Edit: never mind I fixed it by switching the while loop to an if loop. Thank You all.
Last edited by Null_Void; 04-07-2020 at 01:53 AM.