Where did i make a mistake in my program i think its a logical error but i cant quite find it [closed]

The biggest problem is probably that you have not articulated what you are hoping the code will do or what you intended the code to do or what you think it does. I am assuming you just need some help so my attempt to do so is below.

Running this through the compiler and interpreting the error messages helps a little.
Right off the bat, the compiler doesn’t like your call to main. The compiler offers a suggestion that will successfully fix this error, so just follow the advice (and don’t forget to add a
return 0;
statement before you exit main.
Second warning the compiler generates is that you have a semicolon at the end of your while statement. It also tells you how to fix it. Follow the instructions and you should be able to generate an executable.

You will still, however, have problems at runtime. This gets back to what is your intent.
With errors above corrected, your loop_counter variable enters the while loop initialized to -8, increases by 1 on line 19 and again increases by 1 on line 20. A call is made to getchar() but no input is given. Also lines 7, 8, and 9 are not used by your program.

Hope this gives you some direction. 🙂

Leave a Comment