English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm trying this "hello world" program and every time I compile the SC, this error message appears:
C:\Program Files\Miracle C\hello.c: line 1: Parse Error, expecting `SEP'
'1: include 2: 3: int radius, area'
aborting compile

2006-09-04 01:05:02 · 6 answers · asked by login_beta23 1 in Computers & Internet Programming & Design

here's the source code:
1: #include
2:
3: int radius, area;
4:
5: main()
6: {
7:printf("Enter radius (i.e. 10):" );
8:scanf( "%d", &radius );
9:area = 3.14159 * radius * radius;
10:printf( "\n\nArea = %d", area );
11:return 0;
12: }

2006-09-04 23:38:25 · update #1

6 answers

since you didnt show your code, the only thing I see is "include " should be #include , and int radius, area should be int radius, area;. Other than that, who knows without seeing the code you wrote.

2006-09-04 02:55:45 · answer #1 · answered by justme 7 · 0 0

The error message is specific to the compiler you're using: Miracle C (http://www.c-compiler.com/guide/errmessprint.htm ). To put is simple, expecting a SEP means the compiler expects you to put a semicolon in a place that you don't put a semicolon in.

AFAIK, preprocessor functions isn't ended with a semicolons, so your code should actually compile correctly.

My guess is, perhaps your DOS environment doesn't recognize the symbol #, so it passes the # symbol as nothing, and this makes Miracle interpret it as a normal C functions. The reason for this is: the error message states "1: include ... " < the # doesn't appear on this message, while you actually have a # in the source code.

2006-09-07 10:36:14 · answer #2 · answered by Lie Ryan 6 · 0 0

I think there are two booboos here. Try :

#include /* No ; after the lines with a # */

int radius, area; /* Must have ; after normal lines of C */

This is true because the first line is a line intended for the C preprocessor. The second line is a line of standard C code, declaration of two integers named radius and area, to be specific.

I hope this will help you out with the general format.

2006-09-04 14:06:58 · answer #3 · answered by griz803 5 · 0 0

Which compiler are you using ,programming an hello world in c program is the easiest one .
In Linux , open a text file using vi editor and type your program , save it using wq! , and type gcc < program name> . this will create a.out , run that , if any args needed from command line. For other os , search in google.

2006-09-04 08:08:17 · answer #4 · answered by Anonymous · 0 0

post the source code

2006-09-04 08:20:46 · answer #5 · answered by happy_84 k 4 · 0 0

All preprocessor directives start with #
That is, instead of
include
mut be:
#include

2006-09-04 13:25:26 · answer #6 · answered by alakit013 5 · 0 0

fedest.com, questions and answers