C Programming 20

COEP
Lets Crack Online Exam

IT Interview Exam Questions: C Programming 20 (IT Interview Exam Question, IT Campus Placement)

Subject: C Programming 20

Part 20: List for questions and answers of C Language

 

Q1. Choose the correct comments .in a bit-field

a) A field can he un-named

b) a field can be of width 0

c) If a field is un-named, its width must not be zero

d) A field must have a name

 

Q2. The declaration int x : 4; means

a) X is a four digit integer

b) X cannot be greater than a four digit integer

c) x is a four-bit integer

d) None of the above

 

Q3. Bit-fields will he accommodated in a word

a) From left to right

b) From right to left

c) in a way that depends on the implementation

d) None of the above

 

Q4. C preprocessor

a) Takes care of conditional compilation

b) Takes care of macros

c) Takes care of include files and acts before compilation

d) all of the above

 

Q5. A preprocessor command

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

 

Q6. Choose the correct statement

a) The scope of a macro definition need not be the entire program

b) The scope of a macro definition extends from the point of definition to the end of the file

c) New line is a macro definition delimiter and it may go beyond a line

d) all of the above 

 

Q7. The use of macro in the place of functions

a) Reduces execution time

b) Increases code size

c) Increases execution time

d) both (a) and (b)

 

Q8. The process of transforming one bit pattern into another by bit-wise operations is called

a) masking

b) Pruning

c) Biting

d) Chopping

 

Q9. How many bits are absolutely necessary to store an ascii character?

a) 7

b) 8

c) 16

d) 15

 

Q10. If 7 bits are used to store a character, the percentage reduction of needed storage will be

a) 22.5

b) 2.5

c) 8

d) 12.5

 

Q11. Preprocessing is typically done

a) either before or at the beginning of the compilation process

b) After compilation but before execution

c) After loading

d) None of the above

 

Q12. Choose the correct statements

a) ‘X’ is same as “x”

b) Length of the string “x” is two

c) Unless otherwise specified, the first name in an enum has the value 1

d) none of the above 

 

Q13. Consider the following statement.# define hypotenuse(a, b) sqrt (a * a + b * b ) ; the macro-call hypotenuse ( a + 2, b + 3) ;

a) Finds the hypotenuse of a triangle with sides a + 2 and b + 3

b) Finds the square root of (a + 2)2 + (b + 3)2

c) Is invalid

d) finds the square root of 3 * a + 4 * b + 5

 

Q14. The ascending order of precedence of the bit-wise operators &, ^, | is

a) &, ^, |

b) ^, &, i

c) |, ^, &

d) &, |, ^

 

Q15. The scope of a macro definition

a) Cannot be beyond the file in which it is defined

b) May be part of a file

c) Is the entire program

d) excludes string of characters within double quotes

 

Q16. Which of the following comments are correct when macro definition includes arguments?

a) the opening parenthesis should immediately follow the macro name

b) There should be at least one blank between the macro name and the opening parenthesis

c) There should be only one blank between the macro name and the opening parenthesis

d) All the above comments are correct

 

Q17. Lint is

a) A c compiler

b) An inter-active debugger

c) A c interpreter

d) a tool for analyzing a c program

 

Q18. If the bit pattern corresponding to a signed integer is shifted to the right then

a) Vacant bit will be filled by the sign bit

b) Vacant bit will be filled by 0

c) the outcome is implementation dependent

d) None of the above 

 

Q19. What function should be used to free the memory allocated by calloc() ?

a) Dealloc();

b) Malloc(variable_name, 0)

c) free();

d) Memalloc(variable_name, 0) 

 

Part 20: List for questions and answers of C Language

 

Q1. Answer: b

 

Q2. Answer: c

 

Q3. Answer: c

 

Q4. Answer: d

 

Q5. Answer: c

 

Q6. Answer: d

 

Q7. Answer: d

 

Q8. Answer: a

 

Q9. Answer: a

 

Q10. Answer: d

 

Q11. Answer: a

 

Q12. Answer: d

 

Q13. Answer: d

 

Q14. Answer: c

 

Q15. Answer: d

 

Q16. Answer: a

 

Q17. Answer: d

 

Q18. Answer: c

 

Q19. Answer: c