skip to main | skip to sidebar
நிலா
RSS

Basic C questions


1. The Main() function
a. is an optional function used in startup
b. is always the first function executed
c. requires a prototype
d. none of the above

2. printf(), scanf(), getche()
a. are I/O funtions
b. have no relation whatsoever
c. all require format specifers
d. None of the above
3. The escape sequence, \n
a. is used to create a new line
b. is used in the printf statement
c. has the effect of a line feed
d. All of the above
4. To perform a form feed
a. use \t
b. use \b
c. use \h
d. None of the above
5. The %U format specifier
a. represents a long unsigned hex integer
b. represents a long unsigned integer
c. respresents a long unisgned octal integer
d. All of the above
6. C loop functions include
a. do while
b. NEXT
c. GETNEXT
d. none of the above
7. The end of file character
a. is '\0'
b. is '\x1A'
c. can be produced by pressing Ctrl-X
d. None of the above
8. ++n and n++
a. have no difference whatsover
b. show n incremented at different times
c. refer to different C standards
d. None of the above
9. (float)temp
a. is casting variable temp to type float
b. can be used when temp is a long integer
c. can be used when temp is an integer
d. All of the above
10. The ? operator
a. can be used in lieu of if-else statements
b is used as a format specifier
c. is not a legal operator in C
d. None of the above
11. The break statement
a. can be omitted from a switch statement
b. is used to terminate a switch statement
c. will cause the termination of a loop
d. All of the above
12. A single dimension array
a. can be used to store character strings
b. is limited to 256 charactoers
c. cannot be declared without a size
d. None of the above
13. The address of the first element of an array
a. is 0
b. equals the address of the array itself
c. may be a PO Box
d. None of the above
14. The operators * and &
a. are both pointer operators
b. both refer to the address of its operand
c. return the value of an operand
d. None of the above
15. *temp
a. refers to the address of variable, temp
b. refers to a value whose address is stored in temp
c. is a pointer of type temp
d. None of the above
16. 16 bit Integer pointers variables
a. increase by 1 when incremented
b. increase by 2 when incremented
c. cannot be incremented
d. None of the above
17. Union elements
a. occupy the same space in memory
b. must be of the same type
c. cannot be character pointers
d. None of the above
18. An enumeration
a. is a set of integer constants
b. are defined much like structures
c. specifes all legal values that type may have
d. All of the above
19. The bitwise operator, (^)
a. is associated with an AND operation
b. is associated with an OR operation
c. is associated with an XOR operation
d. None of the above
20. The decimal number, 8
a. converted to binary is 100
b. converted to binary is 1000
c. converted to binary is 1100
d. None of the above
21. Static variables
a. have shorter lifetimes than external variables
b. can retain their value even when not visible
c. have external visibility
d. None of the above
22. Linked lists
a. are used when array size is known
b. must contain a link to a previous element
c. are not used in disk-file storage of databases
d. None of the above
23. Pointer arrays
a. are linked lists
b. are binary trees
c. allow for fast element access
d. All of the above
24. Register variables
a. are used to optimize memory
b. should not be used for loop control
c. have no effect on program speed
d. None of the above
25 Pointer arithmetic
a. can be used produce slower, but smaller code
b. is never a good substitute for array indexing
c. is primarly used to clarify code
d. None of the above
Answers:

  1. b
  2. a
  3. d
  4. d
  5. b
  6. a
  7. b
  8. b
  9. d
  10. a
  11. d
  12. a
  13. b
  14. a
  15. b
  16. b
  17. a
  18. d
  19. c
  20. b
  21. b
  22. d
  23. c
  24. d
  25. d











Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

    Pages

    • Home
    • சொர்க்கத்தின் வாசலுக்கு ஓர் பயணம்

    Blog Archive

    • ►  2012 (5)
      • ►  August (1)
      • ►  June (4)
    • ►  2011 (44)
      • ►  August (5)
      • ►  July (3)
      • ►  June (7)
      • ►  May (6)
      • ►  April (9)
      • ►  March (14)
    • ►  2010 (21)
      • ►  October (5)
      • ►  August (2)
      • ►  June (1)
      • ►  May (7)
      • ►  April (4)
      • ►  March (2)
    • ►  2009 (9)
      • ►  February (9)
    • ►  2008 (3)
      • ►  August (3)
    • ▼  2007 (3)
      • ▼  November (1)
        • Basic C questions
      • ►  October (1)
      • ►  September (1)

Copyright © All Rights Reserved. நிலா | Converted into Blogger Templates by Theme Craft