Basic C Programming MCQ Questions and Answers

Practice Mode
Showing 10 of 198 questions
Q171
If the word size is 16 bit, then ~0xc5 will be
  • A 0x3a
  • B 0xff3a
  • C 0x5c
  • D none of the above
Answer: Option B
Q172
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
Answer: Option A
Q173
Which of the following comments about the preprocessor directive # are correct ?
  • A It converts the formal argument in the macro definition into a string.
  • B It strips out redundant blanks
  • C It concatenates adjacent strings, if any.
  • D None of the above
Answer: Option
Q174
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
Answer: Option
Q175
Thu number of possible values of m, such that m & 0x3f equals 0x23 is
  • A 1
  • B 2
  • C 3
  • D 4
Answer: Option D
Q176
As soon as a pointer variable is freed, its value
  • A is set to null
  • B becomes unpredictable
  • C is set to 1
  • D remains the same
Answer: Option D
Q177
calloc(m , n); is equivalent to
  • A malloc(m *n, 0);
  • B memset(0, m*n);
  • C ptr = malloc(m*n); memset(p. o, m*n);
  • D ptr = malloc(m*n); strcpy(p, u);
Answer: Option C
Q178
Which of the following comments are correct when a marco definition includes argumentsd ?
  • 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 marco name and the opening parenthesis.
  • D All the above comments are correct.
Answer: Option A
Q179
Choose the correct statements.
  • A ' x ' is same as " x "
  • B Lengthf 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
Answer: Option D
Q180
Choose the correct statements.
  • A enum variables can be assigned new values.
  • B enum variables can be eompared.
  • C Enumeration feature does not increase the power of C.
  • D Use of enumeration enhances the logical clarity of a program.
Answer: Option
Questions and Answers for Competitive Exams Various Entrance Test