Fundamental C Test2

40 Questions | Total Attempts: 824

SettingsSettingsSettings
Please wait...
C Programming Quizzes & Trivia

This test is to rate your fundamental C concepts


Questions and Answers
  • 1. 
    The process of removing a bug is known as
    • A. 

      Debugging

    • B. 

      Compilation

    • C. 

      Executing

    • D. 

      Running

  • 2. 
    Every C Program Statement must be terminated with a
    • A. 

      .

    • B. 

      #

    • C. 

      ;

    • D. 

      !

  • 3. 
    In the following which one is not a C keyword?
    • A. 

      Choice

    • B. 

      Case

    • C. 

      For

    • D. 

      Volatile

  • 4. 
    What is the range of unsigned char data type
    • A. 

      0 to 512

    • B. 

      0 to 255

    • C. 

      -128 to 127

    • D. 

      -32, 768 to 32,767

  • 5. 
    C variable cannot start with
    • A. 

      A lower case

    • B. 

      An underscore

    • C. 

      A number

    • D. 

      An upper case letter

  • 6. 
    Which of the following is allowed in a C arithmetic statement
    • A. 

      ( )

    • B. 

      [ ]

    • C. 

      { }

    • D. 

      / /

  • 7. 
    What is the result of 5 &&2 ?
    • A. 

      0

    • B. 

      2

    • C. 

      1

    • D. 

      5

  • 8. 
    ++I is a ----------------------operator.
    • A. 

      Pre-decrement

    • B. 

      Pre-increment

    • C. 

      Post increment

    • D. 

      Post decrement

  • 9. 
    Which of the following shows the correct hierarchy of arithmetic operations in C
    • A. 

      ( ), &&, *,/,+,-

    • B. 

      ( ), &&, / , *, +, -

    • C. 

      ( ),&&,*or / + or -;

    • D. 

      ( ), / or *, - or +

  • 10. 
    The output of the following program is main( ) {int i=2; printf(“%d %d %d”,i++,i,++i); }
    • A. 

      2 2 4

    • B. 

      2 3 3

    • C. 

      3 3 3

    • D. 

      2 3 4

  • 11. 
    In switch (expression) statement, the expression should evaluate to
    • A. 

      A void

    • B. 

      An integer

    • C. 

      A character

    • D. 

      A float

  • 12. 
    How many while statements are possible in do.... While loop?
    • A. 

      Any number

    • B. 

      2

    • C. 

      3

    • D. 

      1

  • 13. 
    What type of errors are checked during compilation
    • A. 

      Divide by zero error

    • B. 

      Logical errors

    • C. 

      Run - time errors

    • D. 

      Syntax errors

  • 14. 
    Which of the following is a valid numeric constant
    • A. 

      20,000

    • B. 

      15 750

    • C. 

      $1000

    • D. 

      65432

  • 15. 
    What is range of char data value?
    • A. 

      -128 to 127

    • B. 

      -64 to 64

    • C. 

      0 to 255

    • D. 

      -127 to 128

  • 16. 
    Which of the following is the assignment operator in C
    • A. 

      !=

    • B. 

      = =

    • C. 

      =

    • D. 

      : =

  • 17. 
    The equality relational operator is represent by
    • A. 

      :=

    • B. 

      ==

    • C. 

      .EQ

    • D. 

      =

  • 18. 
    main( ) { int a=0; if(a) printf(“%d”,++a); else printf(“%d”, a+=2) ; } the output is
    • A. 

      3

    • B. 

      1

    • C. 

      2

    • D. 

      0

  • 19. 
    x=9-12/3+3*2-1, what is the value of x
    • A. 

      -10

    • B. 

      10

    • C. 

      4

    • D. 

      2

  • 20. 
    The function -------------------echoes the character typed on the screen
    • A. 

      Getchar()

    • B. 

      Gets()

    • C. 

      Getche()

    • D. 

      Getchr()

  • 21. 
    Size of (double) returns———
    • A. 

      8

    • B. 

      2

    • C. 

      10

    • D. 

      4

  • 22. 
    The symbol for right shift operator is
    • A. 

      − >

    • B. 

      >

    • C. 

    • D. 

      >>

  • 23. 
    What function is appropriate for accepting a string?
    • A. 

      Getch ( )

    • B. 

      Gets( )

    • C. 

      Getche ( )

    • D. 

      Scanf ( )

  • 24. 
    ‘void’ means
    • A. 

      1

    • B. 

      Nothing

    • C. 

      Something not known

    • D. 

      0

  • 25. 
    How would you declare a constant of 5 called “MYCONST”?
    • A. 

      #define MYCONST 5

    • B. 

      Var int MYCONST=5

    • C. 

      Int myconst = 5;

    • D. 

      Constant MYCONST = 5;