C Multiple Choice Questions

Our C questions and answers focuses on all areas of C programming language covering 100+ topics in C

C Preprocessor-1 MCQs

C Preprocessor-1

1. What are the types of C Preprocessor Directives?

a) Macros
b) Conditional Compilation
c) File Inclusion
d) All the above

2. Processor Directive in C language starts with?

a) $ symbol (DOLLAR)
b) @ symbol (At The Rate)
c) & symbol (Ampersand)
d) # symbol (HASH)

3. Preprocessor in C language works on?

a) DOTC file (.c)
b) DOTEXE file (.exe)
c) DOTH file (.h)
d) DOTCP file (.cp)

4. What is the another name for .C file?

a) Executable code
b) Source Code
c) Distributable Code
d) Macro code

5. What is the keyword used to define a C macro?

a) def
b) definition
c) define
d) defy

6. What will be the output of the following C code?
#include <stdio.h>
#define max 100
void main() {
#ifdef max

a) 100
b) hello
c) "hello"
d) error

7. __________ is the Preprocessor directive which is used to end the scope of #ifdef.

a) #elif
b) #ifndef
c) #endif
d) #if

8. The preprocessor directive which checks whether a constant expression results in a zero or non-zero value __________

a) #if
b) #ifdef
c) #undef
d) #ifndef

9. What will be the output of the following program?
#include <stdio.h>
#define max 100
void main() {
#if (max%10)

a) error
b) Alg
c) bly
d) ALgbly

10. The preprocessor directive which is used to remove the definition of an identifier which was previously defined with #define?

a) #ifdef
b) #undef
c) #ifndef
d) #def

- Related Topics