By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,852 Members | 2,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,852 IT Pros & Developers. It's quick & easy.

error statement missing in c language

P: 1
Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main ()
  4. {
  5. int n,a;
  6. clrscr();
  7. n=1;
  8.   do
  9.     {
  10.       do
  11.     {
  12.       a=1;
  13.       printf("A");
  14.       a++;
  15.     }while(a<=n);
  16.     printf("\n")
  17.        n=n+1;
  18.      }while(n>=5);
  19.    getch();
  20.  }
i am a studend..i am learning c language
here is the program that shows the error statement missing in n=n+1. Why it shows the error?
Nov 10 '15 #1
Share this Question
Share on Google+
2 Replies


zmbd
Expert Mod 5K+
P: 5,397
+ Moved from Access/VBA to C-forums.
+ Please always use the [CODE/] format tool to format your posted script
+ Please pay attention to where you post your questions.

We do not normally do homework problems.
Can you tell us what you've done to trouble shoot this program and we'll guide you from there...
Nov 10 '15 #2

Expert 100+
P: 2,398
A syntax mistake on one line may not be detectable to the compiler until a subsequent line. In general, when the compiler reports an error, start at the indicated by the error message and scan upwards.

By the way, consider your two loops. The outer loop has n going from 1 to 6. What is the range of a inside the inner loop when n is, let's say, 3?

By the way, the C Standard requires that main return an int. You defined it to return void.
Nov 11 '15 #3

Post your reply

Sign in to post your reply or Sign up for a free account.