1

None of your vars are declared (or declared correctly). The code shows that you don't have a grasp of how to declare variables. I suggest you go back and watch the first week's lectures until you understand the syntax of how to declare them.


1

Two problems: the semicolon after main() and the placement of the curly braces. The structure of a program should look like this: #include... //includes first int main(void) //note no semicolon here { // nothing between the main declaration line and the opening curly brace. // program code goes here } // closing curly brace to end main. ...


1

Variables in C are declared in block-scope. You can access all variables in current scope, and in scopes that contain the current scope (unless shadowed by variables of the same name declared in more inner scopes). You would have to declare i in a scope that's above (in a hierarchical sense) the do..while loop, though some of your code makes little sense to ...


1

Where is i declared before it is used in the first three lines? Based on the usage, I would guess that it should be declared as int i; somewhere before it is used, and initialized to some value. If this isn't the problem, please edit the question and add the code that precedes the first 3 lines shown. If this answers your question, please click on the ...


Only top voted, non community-wiki answers of a minimum length are eligible