C Programming – C-Preprocessor

C Programming - C-Preprocessor

Question 1
Property which allows to produce different executable for different platforms in C is called?
A
File inclusion
B
Selective inclusion
C
Conditional compilation
D
Recursive macros
Question 2
#include is called
A
Preprocessor directive
B
Inclusion directive
C
File inclusion directive
D
None of the mentioned
Question 3
 C preprocessors can have compiler specific features.
A
true
B
false
C
Depends on the standard
D
Depends on the platform
Question 4
What is the output of this C code?
    #include 
    #define foo(m, n) m * n = 10
    int main()
    {
    printf("in main\n");
    }
A
In main
B
Compilation error as lvalue is required for the expression m*n=10
C
Preprocessor error as lvalue is required for the expression m*n=10
D
None of the mentioned
Question 5
 C preprocessor is conceptually the first step during compilation
A
true
B
false
C
Depends on the compiler
D
Depends on the standard
Question 6
Preprocessor feature that supply line numbers and filenames to compiler is called?
A
Selective inclusion
B
macro substitution
C
Concatenation
D
Line control
Question 7
 #include are _______ files and #include “somefile.h” ________ files.
A
Library, Library
B
Library, user-created header
C
User-created header, library
D
They can include all types of file
Question 8
 A preprocessor is a program
A
That processes its input data to produce output that is used as input to another program
B
That is nothing but a loader
C
That links various source files
D
All of the mentioned
Question 9
 Which of the following are C preprocessors?
A
#ifdef
B
#define
C
#endif
D
All of the mentioned
Question 10
 #include statement must be written
A
Before main()
B
Before any scanf/printf
C
After main()
D
It can be written anywhere
Question 11
#pragma exit is primarily used for?
A
Checking memory leaks after exitting the program
B
Informing Operating System that program has terminated
C
Running a function at exitting the program
D
No such preprocessor exist
Question 12
What is the output of this C code?
    #include 
    int main()
    {
    int one = 1, two = 2;
    #ifdef next
    one = 2;
    two = 1;
    #endif
    printf("%d, %d", one, two);
    }
A
1, 1
B
1, 2
C
2, 1
D
2, 2
Question 13
The C-preprocessors are specified with _________symbol.
A
#
B
$
C
” ”
D
None of the mentioned
Question 14
 The #include directive
A
Tells the preprocessor to grab the text of a file and place it directly into the current file
B
Statements are typically placed at the top of a program
C
both a & b
D
None of a & b
Question 15
The preprocessor provides the ability for _______________.
A
The inclusion of header files
B
The inclusion of macro expansions
C
Conditional compilation and line control.
D
All of the mentioned
Question 16
 If #include is used with file name in angular brackets
A
The file is searched for in the standard compiler include paths
B
The search path is expanded to include the current source directory
C
Both a & b
D
None of the mentioned

Check Your Answers:

  1. C
  2. A
  3. A
  4. A
  5. A
  6. D
  7. D
  8. A
  9. D
10. B
11. C
12. B
13. A
14. C
15. D
16. A


SHARE

Unknown

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment