A PHP Error was encountered

Severity: Warning

Message: A non-numeric value encountered

Filename: controllers/home.php

Line Number: 222

A PHP Error was encountered

Severity: Warning

Message: A non-numeric value encountered

Filename: controllers/home.php

Line Number: 228

C Preprocessor - C Programming Questions and Answers
Home / C Programming / C Preprocessor :: C Preprocessor MCQs

C Programming :: C Preprocessor

  1. C preprocessor

  2. A.

     Takes care of conditional compilation

    B.

     Takes care of macros

    C.

     Takes care of include files

    D.

     Acts before compilation

    E.

     All of the above

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. A preprocessor command

  4. A.

     need not start on a new line

    B.

     need not start on the first column

    C.

     has # as the first character

    D.

     comes before the first executable statement

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. What will be the output of the program?

    #include<stdio.h>

    #define int char

    void main()

    {

    int i = 65;

    printf("sizeof(i)=%d", sizeof(i));

    }

  6. A.

     sizeof(i)=2

    B.

     sizeof(i)=1

    C.

     Compiler Error

    D.

     None of These

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. What will be the output of the following program?

    #include<stdio.h>

    #define square(x) x*x

    void main()

    {

    int i;

    i = 64/square(4);

    printf("%d", i);

    }

  8. A.

     4

    B.

     64

    C.

     16

    D.

     None of These

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. What will be the output of the program code?

    #include<stdio.h>

    #define a 10

    void main()

    {

    #define a 50

    printf("%d", a);

    }

  10. A.

     50

    B.

     10

    C.

     Compiler Error

    D.

     None of These

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. Choose the correct statement.
    I.   The scope of a macro definition need not be the entire program.
    II.  The scope of a macro definition extends from the point of definition to the end of the file.
    III. New line is a macro definition delimiter.
    IV.  A macro definition may go beyond a line.

  12. A.

     I and II

    B.

     II and III

    C.

     I, II and III

    D.

     II, III and IV

    E.

     I, II, III and IV

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. Determine output:

    #include<stdio.h>

    #define clrscr() 100

    void main()

    {

    clrscr();

    printf("%dn", clrscr());

    }

  14. A.

     0

    B.

     1

    C.

     100

    D.

     Error

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. What will be the output of the following program?

    #include<stdio.h>

    #define prod(a,b) a*b

    void main()

    {

    int x=3,y=4;

    printf("%d", prod(x+2,y-1));

    }

  16. A.

     15

    B.

     12

    C.

     10

    D.

     11

    E.

     None of these

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. In which stage the following code
    #include<stdio.h>
    gets replaced by the contents of the file stdio.h

  18. A.

     During Preprocessing

    B.

     During Execution

    C.

     During linking

    D.

     During Editing

    E.

     None of these

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. What will be output if you will compile and execute the following c code?

    #include<stdio.h>

    #define max 5

    void main(){

    int i = 0;

    i = max++;

    printf("%d", i++);

    }

  20. A.

     5

    B.

     6

    C.

     7

    D.

     0

    E.

     Compiler Error

    View Answer

    Workspace

    Discuss Discuss in Forum