Intro To C Programming Quiz 1

20 Questions | Total Attempts: 3269

SettingsSettingsSettings
Please wait...
Intro To C Programming Quiz 1

This is a make-up exam for Quiz 1.


Questions and Answers
  • 1. 
    A placeholder begins with the symbol _____.
    • A. 

      *

    • B. 

      !

    • C. 

      %

    • D. 

      &

  • 2. 
    The "\n" character does which of the following operations?
    • A. 

      Double line spacing

    • B. 

      Character deletion

    • C. 

      Character backspace

    • D. 

      Places cursor on the next line

  • 3. 
    #define PI 3.14159 The above code represents which of the following?
    • A. 

      Preprocessor directive

    • B. 

      Variable

    • C. 

      Constant macro

  • 4. 
    Which symbol separates variable names?
    • A. 

      &

    • B. 

      . (period)

    • C. 

      ' (apostrophe)

    • D. 

      , (comma)

    • E. 

      ; (semicolon)

  • 5. 
    Which symbol terminates a C statement?
    • A. 

      . (period)

    • B. 

      ; (semicolon)

    • C. 

      : (colon)

    • D. 

      , (comma)

  • 6. 
    The compiler ignores comments and they are not translated into machine language.
    • A. 

      True

    • B. 

      False

  • 7. 
    Which of the following represent comments in C?
    • A. 

    • B. 

      [ , ]

    • C. 

      /*, /*

    • D. 

      */, /*

    • E. 

      /*, */

  • 8. 
    Which arithmetic operator in C returns the integer remainder of the result of dividing its first operand by its second?
    • A. 

      %

    • B. 

      /

    • C. 

      \

    • D. 

      *

  • 9. 
    Which of the following is a valid name for an identifier in C?
    • A. 

      !Here

    • B. 

      4Me_To_You

    • C. 

      Emp_Num1

  • 10. 
    Which of the following operations gets evaluated first?
    • A. 

      * - multiplication

    • B. 

      () - parentheses

    • C. 

      / - division

    • D. 

      + - addition

  • 11. 
    If your program gets an error when dividing by zero, this type of error is called?
    • A. 

      Syntax

    • B. 

      Run-time

    • C. 

      Undetected

    • D. 

      Logic

  • 12. 
    Your C program was able to compile. However, the result is incorrect. What type of error is this?
    • A. 

      Undetected

    • B. 

      Run-time

    • C. 

      Syntax

    • D. 

      Logic

  • 13. 
    Your C program always fails to compile and has these errors. What type of errors are present?
    • A. 

      Syntax

    • B. 

      Run-time

    • C. 

      Logic

    • D. 

      Undetected

  • 14. 
    The section of C code after the preprocessor directives is generally for?
    • A. 

      User-defined function definitions

    • B. 

      Function prototypes

    • C. 

      Variables

  • 15. 
    Is the syntax for the following C statement correct?:scanf("%d", input);
    • A. 

      True

    • B. 

      False

  • 16. 
    When a C program asks the user to input data using the keyboard, the program is said to be in __________ mode.
    • A. 

      Batch

    • B. 

      Interactive

    • C. 

      Preprocessor

  • 17. 
    • A. 

      25

    • B. 

      22

    • C. 

      16

    • D. 

      60

  • 18. 
    You can have more than one main function.
    • A. 

      True

    • B. 

      False

  • 19. 
    In general, the body of a function is represented by the following symbols?
    • A. 

      [, ]

    • B. 

      {, }

    • C. 

      /, \

    • D. 

      /*, */

  • 20. 
    A number such as 45.567 needs to be stored in a variable of which data type?
    • A. 

      Int

    • B. 

      Char

    • C. 

      Double