C Programming - C Preprocessor - Discussion

Discussion Forum : C Preprocessor - True / False Questions (Q.No. 8)
8.
Every C program will contain at least one preprocessor directive.
True
False
Answer: Option
Explanation:

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

Discussion:
9 comments Page 1 of 1.

Sundar Raj said:   1 decade ago
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:   1 decade ago
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:   1 decade ago
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:   1 decade ago
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:   1 decade ago
Yeah we can write program without preprocessor directives.

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

Chandrabhan said:   1 decade ago
Can we use html with C language?

Ramki said:   1 decade ago
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:   8 years ago
@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:   8 years ago
@Sundar i.e works only in turbo c not Linux.

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

Post your comments here:

Your comments will be displayed after verification.