Basic C Programming MCQ
Basic C Programming MCQ
172. Preprocessing is typically done
- either before or at the beginning of the compilation process
- after compilation but before execution
- after loading
- none of the above
173. Which of the following comments about the preprocessor directive # are correct ?
- It converts the formal argument in the macro definition into a string.
- It strips out redundant blanks
- It concatenates adjacent strings, if any.
- None of the above
174. The scope of a macro definition
- cannot be beyond the file in which it is defined
- may be part of a file
- is the entire program
- excludes string of characters within double quotes
176. As soon as a pointer variable is freed, its value
- is set to null
- becomes unpredictable
- is set to 1
- remains the same
177. calloc(m , n); is equivalent to
- malloc(m *n, 0);
- memset(0, m*n);
- ptr = malloc(m*n); memset(p. o, m*n);
- ptr = malloc(m*n); strcpy(p, u);
178. Which of the following comments are correct when a marco definition includes argumentsd ?
- The opening parenthesis should immediately follow the macro name.
- There should be at least one blank between the macro name and the opening parenthesis
- There should be only one blank between the marco name and the opening parenthesis.
- All the above comments are correct.
179. Choose the correct statements.
- ' x ' is same as " x "
- Lengthf of the string " x " is two
- Unless otherwise specified, the first name in an enum has the value 1.
- None of the above
180. Choose the correct statements.
- enum variables can be assigned new values.
- enum variables can be eompared.
- Enumeration feature does not increase the power of C.
- Use of enumeration enhances the logical clarity of a program.