C Programming - C Preprocessor - Discussion


Every C program will contain at least one preprocessor directive.

[A]. True
[B]. False

Answer: Option B


False, the preprocessor directive is not mandatory in any c program.

Sundar Raj said: (Aug 20, 2010)  
Can anyone explain why preprocessor directive is not mandatory in C?

My doubt is, if we use any of the library function, we have to use '#include' preprocessor directive? then how, preprocessor is not mandatory?

Sundar said: (Aug 20, 2010)  
The following is a valid C Program:

int main()
int a = 10, b = 20;

int sum = a + b;

return 0;

It contains no '#include' directive.

We can print values on the screen even without using any header files in Turbo C (Windows).

Raja said: (Sep 2, 2010)  
If you use DEV-C compiler in that you need not to write #include<stdio. H>,.

With out this library function also program works perfectly.

Ravi said: (Sep 18, 2011)  
For above program we have to save it first with file extension(.c) then we can print values on the screen even without using header files in Turbo C (Windows).

Harmeeet Singh said: (Mar 13, 2012)  
Yeah we can write program without preprocessor directives.

But what was a need to include preprocessor directive in a program.

Chandrabhan said: (Sep 13, 2014)  
Can we use html with C language?

Ramki said: (Nov 17, 2014)  
Without using preprocessing is only applicable for turbo c++, because it default (automatically) allocate preprocessor directive to the created file.

It is not suitable for others compilers. You must include the header files console and standard input output.

Muhammad Yusuf Khan said: (Mar 22, 2017)  
@Sundar's program (I.e. sum) we have to use printf statement and it can only be used when we include the header file.

Am I right? Which means preprocessor in mandatory in every C program from which we have to get output.

Itz Me Sundra said: (Nov 4, 2017)  
@Sundar i.e works only in turbo c not Linux.

Linux must need pre-processors i.e including header files.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.