Explore topic-wise MCQs in C Multiple Choice.

This section includes 16 Mcqs, each offering curated multiple-choice questions to sharpen your C Multiple Choice knowledge and support exam preparation. Choose a topic below to get started.

1.

Which macro can be used to detect and report exceptional conditions?

A. extern
B. edom
C. assert
D. lbdl_min 1e-37
Answer» D. lbdl_min 1e-37
2.

Which line from the given code is the passive form?

A. #define assert(test)
B. #define assert(test) ((void)0)
C. #ifdef NDEBUG
D. 0)c) #ifdef NDEBUGd) #undef assertView Answer
Answer» C. #ifdef NDEBUG
3.

The source filename and line number come from the preprocessor macros ________ and ______

A. _ _FILE_ _ and _ _LINE_ _
B. _ _NAME_ _ and _ _NUMBER_ _
C. _ _FILENAME_ _ and _ _NMN_ _
D. _ _FILE_ _ and _ _NUM_ _
Answer» B. _ _NAME_ _ and _ _NUMBER_ _
4.

The following message is displayed in stderr.Assertion failed: expression, file filenum, line nmn

A. true
B. false
Answer» B. false
5.

WHICH_FUNCTION_IS_CALLED_BY_MACRO_ASSERT_TO_TERMINATE_THE_EXECUTION??$

A. exit()
B. atexit()
C. abort()
D. no function called
Answer» D. no function called
6.

void assert(int expression) when the expression is evaluated to true?

A. assert returns integer value
B. assert displays error message
C. assert returns nothing
D. assert displays pattern
Answer» D. assert displays pattern
7.

If the expression in void assert(int expression) is zero then a message is printed on stderr(standard error file).

A. true
B. false
Answer» B. false
8.

Which is the correct declaration of macro assert?

A. void assert(int expression);
B. void assert(float expression);
C. void assert(double expression);
D. void assert( expression);
Answer» B. void assert(float expression);
9.

The macro void assert(int expression) allows the diagnostic information to be written in which of the following files?

A. standard error file
B. output file
C. string file
D. character file
Answer» B. output file
10.

The assert macro returns__________value.

A. integer
B. float
C. double
D. no
Answer» E.
11.

The assert shall be implemented as a ______ not as an actual ________

A. function, macro
B. macro, function
C. header, macro
D. macro, header
Answer» C. header, macro
12.

If NDEBUG is defined as a macro name, at the point where is included, then assert macro is defined as #define assert(ignore) ((void)0).

A. true
B. false
Answer» B. false
13.

The function abort() is defined in which of the following header file?

A. stdio.h
B. stdarg.h
C. stdlib.h
D. assert.h
Answer» D. assert.h
14.

What is the name of the macro that is referred by assert macro defined in assert .h?

A. STDARG
B. SETJMP
C. NDEBUG
D. STDERR
Answer» D. STDERR
15.

The source filename and line number come from the preprocessor macros________and______

A. _ _FILE_ _ and _ _LINE_ _
B. _ _NAME_ _ and _ _NUMBER_ _
C. _ _FILENAME_ _ and _ _NMN_ _
D. _ _FILE_ _ and _ _NUM_ _
Answer» B. _ _NAME_ _ and _ _NUMBER_ _
16.

The following message is displayed in stderr.

A.
B. true
Answer» B. true