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

C Error - Unable to Open 'stdio.h' & Declaration Syntax Error

P: 2
Can someone help me w/ this
I can't run it and I keep getting errors
unable to open include file 'stdio.h' and declaration syntax error

Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. main();
  3. {
  4.       int a,b,c;
  5.       clrscr();
  6.       printf("a=");
  7.       scanf("%d",&a);
  8.       printf("b=");
  9.       scanf("%d",&b);
  10.       c = a/b;
  11.       printf("answer is %d",c);
  12.       printf("answer is %d",c);
  13.       getch();
  14.       }
Jul 13 '08 #1
Share this Question
Share on Google+
2 Replies


Expert 10K+
P: 11,448
If your compiler can't find the stdio.h file, check your installation. A function isn't
defined like you did; do this instead:

Expand|Select|Wrap|Line Numbers
  1. int main() { /* no semicolon here */
  2.    ...
  3.    /* body of your function here */
  4.    ...
  5.    return 0; /* last statement of main()
  6. }
  7.  
I'm sure you can figure it out from here.

kind regards,

Jos
Jul 13 '08 #2

P: 2
Thanks for the help >.<
Jul 13 '08 #3

Post your reply

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