InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
Select the right statement.(a) synchronous signal occurs because of the action that your program takes(b) synchronous signal occurs because of action outside your program(c) asynchronous signal occurs because of the action that your program takes(d) division by zero is asynchronousI had been asked this question in an interview.Question is from Signal Handling in section C Library of C |
|
Answer» Right option is (a) SYNCHRONOUS signal OCCURS because of the ACTION that your PROGRAM takes |
|
| 52. |
How many times can the macro setjmp() return?(a) one time(b) two times(c) three times(d) many timesI had been asked this question in class test.The question is from Non-Local Jumps topic in section C Library of C |
|
Answer» The correct choice is (b) two times |
|
| 53. |
Which of the following macros is not defined?(a) ULONG_MIN(b) LONG_MIN(c) ULONG_MAX(d) LONG_MAXThe question was posed to me by my college director while I was bunking the class.The above asked question is from Implementation-Defined Limits in section C Library of C |
|
Answer» The CORRECT answer is (a) ULONG_MIN |
|
| 54. |
Which of the given statement is not true with respect to void longjmp( jmp-buf env, int val)?(a) The variable value cannot be zero(b) env is the object containing information to restore the environment at the jmp_buf’s calling point(c) This function does not return any value(d) This function restores the environment saved by the most recent call to setjmp() macroThe question was asked in unit test.My doubt stems from Non-Local Jumps in portion C Library of C |
|
Answer» CORRECT OPTION is (b) env is the object containing information to restore the environment at the jmp_buf’s calling point To explain: In the FUNCTION VOID LONGJMP( jmp-buf env, int val), env is the object containing information to restore the environment at the setjmp’s calling point. |
|
| 55. |
What is the function of the given longjump(jmp_buf buf, i)?(a) go back to place buf is pointing to and return i(b) go back to place buf is pointing to and return 0(c) uses buf to remember current position and returns 0(d) uses buf to remember current position and returns iI have been asked this question in an interview for internship.I'd like to ask this question from Non-Local Jumps in portion C Library of C |
|
Answer» RIGHT answer is (a) go back to PLACE buf is pointing to and RETURN i Explanation: In the given function longjmp(jmp_buf buf,i), it goes back to place buf is pointing to and return i.setjmp(jmp_bufbuf) uses buf to remember current position to and return 0. |
|
| 56. |
Select the macro that abnormally terminates the program.(a) SIGILL(b) SIGTERM(c) SIGABRT(d) SIGFPEI had been asked this question in an interview.My enquiry is from Signal Handling topic in portion C Library of C |
|
Answer» Correct option is (c) SIGABRT |
|
| 57. |
Which function restores the environment saved by the most recent invocation of the setjmp() macro in the same invocation of the program?(a) jmp_buf(b) longjmp(c) jmpbuf(d) long_jmpI got this question during an internship interview.Origin of the question is Non-Local Jumps topic in portion C Library of C |
|
Answer» Right OPTION is (b) LONGJMP |
|
| 58. |
Which macro affects the strftime() function?(a) LC_TIME(b) LC_SEC(c) LC_MIN(d) LC_SETThis question was addressed to me in my homework.Enquiry is from Localization in portion C Library of C |
|
Answer» The correct OPTION is (a) LC_TIME |
|
| 59. |
Which of the given options is an array type used for holding information?(a) longjmp(b) setjmp(c) jmp_buf(d) no such variableI got this question during an internship interview.My doubt is from Non-Local Jumps topic in portion C Library of C |
|
Answer» RIGHT option is (c) jmp_buf Explanation: jmp_buf is an ARRAY TYPE used for holding information of macro setjmp() and function longjmp().This is a VARIABLE type defined under the header file setjmp.h. |
|
| 60. |
The macro offset expands to a constant of type __________________(a) size_t(b) print_t(c) ptrdiff_t(d) nullThis question was posed to me in class test.Query is from Standard Definition in division C Library of C |
|
Answer» The CORRECT CHOICE is (a) size_t |
|
| 61. |
The three macros defined by stdarg.h is _________(a) start(), arg() and end()(b) var_start(), var_arg() and var_end()(c) va_start(), va_arg() and va_end()(d) v_start(), v_arg() and v_end()The question was asked by my college professor while I was bunking the class.My question is from Variable Argument Lists in division C Library of C |
|
Answer» Right option is (C) va_start(), va_arg() and va_end() |
|
| 62. |
What is the name of the macro that is referred by assert macro defined in assert .h?(a) STDARG(b) SETJMP(c) NDEBUG(d) STDERRI got this question in quiz.Query is from Diagnostics topic in division C Library of C |
|
Answer» The CORRECT choice is (C) NDEBUG |
|
| 63. |
The behavior is undefined if more than one call to the exit function is executed by a program.(a) true(b) falseThe question was asked during an interview for a job.Asked question is from General Utilities topic in section C Library of C |
|
Answer» CORRECT CHOICE is (a) true Easy explanation - The EXIT() function causes normal program termination to occur. The BEHAVIOR is undefined if more than one call to the exit function is executed by a program. |
|
| 64. |
double ______ (double x, double y) computes the floating-point remainder of x/y.(a) modf(b) fmod(c) ceil(d) floorThe question was posed to me in final exam.This key question is from Mathematical functions topic in chapter C Library of C |
|
Answer» CORRECT ANSWER is (b) FMOD Explanation: double fmod(doublr x, double y); The fmod() FUNCTION computes the floating-point remainder of x/y. |
|
| 65. |
Which of the given function differs from the statement’errno is not neccessarily set on conversion error’?(a) atof()(b) atoi()(c) atol()(d) strtod()This question was posed to me by my school principal while I was bunking the class.My question comes from General Utilities topic in division C Library of C |
|
Answer» The correct option is (d) strtod() |
|
| 66. |
Which function is called repeatedly by bsearch() to compare search elements against the elements in the array?(a) mblem()(b) wctomb()(c) compar()(d) labs()I got this question during an interview.I would like to ask this question from General Utilities topic in division C Library of C |
|
Answer» Right option is (c) compar() |
|
| 67. |
The_______function converts the initial portion of the string pointed to by, to int representation.(a) atof()(b) atoi()(c) strtod()(d) atol()This question was posed to me in an interview for job.Asked question is from General Utilities topic in section C Library of C |
|
Answer» Right option is (B) atoi() |
|
| 68. |
Name the function that breaks a floating-point number into a normalized fraction and an integral power of 2.(a) exp()(b) frexp()(c) Idexp()(d) modf()I have been asked this question in a job interview.This is a very interesting question from Mathematical functions in chapter C Library of C |
|
Answer» Correct ANSWER is (b) frexp() |
|
| 69. |
Whichmacro retrieves the next argument in the parameter list of the function with type type?(a) type va_arg(va_list ap, type)(b) type var_arg(va_list ap, type)(c) type v_arg(va_list ap, type)(d) type val_arg(va_list ap, type)This question was posed to me by my school principal while I was bunking the class.I want to ask this question from Variable Argument Lists topic in section C Library of C |
|
Answer» Correct ANSWER is (a) TYPE va_arg(va_list ap, type) |
|
| 70. |
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);The question was asked in class test.My question is based upon Diagnostics in chapter C Library of C |
|
Answer» CORRECT answer is (a) VOID assert(INT expression); To explain: The RIGHT declaration of the macro assert DEFINED under the header file assert.h is void assert(int expression), expression can be any variable. |
|
| 71. |
The number of bytes contained in the multibyte character pointed to by a character is ___________(a) getenv()(b) bsearch()(c) mblen()(d) qsort()This question was addressed to me at a job interview.Enquiry is from General Utilities in portion C Library of C |
|
Answer» Correct answer is (c) mblen() |
|
| 72. |
_______variable type defined in the header stdlib.h is an integer type of the size of a wide character constant.(a) size_t(b) wchar_t(c) div_t(d) ldiv_tI had been asked this question during an online exam.I need to ask this question from General Utilities in portion C Library of C |
|
Answer» Correct option is (b) wchar_t |
|
| 73. |
A range error occurs if the result of the function cannot be represented as a value.(a) int(b) short int(c) double(d) floatI had been asked this question during an interview for a job.Query is from Mathematical Functions in chapter C Library of C |
|
Answer» RIGHT OPTION is (c) DOUBLE Explanation: if the result of the function cannot be REPRESENTED as a double value, a range error OCCURS. If the result overflows (the magnitude of the result is so large that it cannot be represented in an object of the specified type), the function returns the value of the macro HUGE_VAL, with the same sign as the correct value of the function. |
|
| 74. |
The assert macro returns__________value.(a) integer(b) float(c) double(d) noI had been asked this question in an internship interview.Enquiry is from Diagnostics in section C Library of C |
|
Answer» Right option is (d) no |
|
| 75. |
void free(void *ptr) deallocates the memory previously allocated by a call to _______________or _________(a) malloc,getenv,abort(b) calloc,malloc,exit(c) calloc,malloc,realloc(d) exit,getenv,abortThis question was posed to me in an interview for internship.Asked question is from General Utilities in division C Library of C |
|
Answer» Correct option is (c) calloc,MALLOC,realloc |
|
| 76. |
Which of the given structure is returned by the function ldiv()?(a) div_t(b) ldiv_t(c) div_i(d) ldiv_iI had been asked this question in class test.The above asked question is from General Utilities topic in section C Library of C |
|
Answer» Right option is (B) ldiv_t |
|
| 77. |
The assert shall be implemented as a ______ not as an actual ________(a) function, macro(b) macro, function(c) header, macro(d) macro, headerI have been asked this question in an interview for internship.My doubt stems from Diagnostics topic in portion C Library of C |
|
Answer» Right OPTION is (b) macro, function |
|
| 78. |
Choose the correct statement.(a) bsearch() returns no value to the function(b) getenv() returns no value to the function(c) qsort() returns no value to the function(d) realloc() returns no value to the functionThis question was addressed to me in exam.Asked question is from General Utilities topic in portion C Library of C |
|
Answer» RIGHT OPTION is (c) qsort() returns no value to the function The BEST I can explain: The qsort() function does not RETURN any value. |
|
| 79. |
Which of the following is the correct description of EXIT_FAILURE?(a) This is the value for the exit function to return in case of failure(b) This is the value for the exit function to terminate the program(c) This is the value for the exit function to return in case of success(d) This is the value for the exit function to return in case it is the maximum valueThis question was posed to me in an online interview.This intriguing question originated from General Utilities in chapter C Library of C |
|
Answer» The correct ANSWER is (a) This is the value for the exit function to return in case of failure |
|
| 80. |
What error occurs if the magnitude of x is too large in sinh(double x)?(a) domain error(b) range error(c) no error(d) zero is returnedI got this question during an online exam.Enquiry is from Mathematical functions in section C Library of C |
|
Answer» Correct choice is (b) RANGE ERROR |
|
| 81. |
The _______ macro shall be invoked before any access to the unnamed arguments.(a) va_arg(b) va_end(c) va_list(d) va_startI got this question in an interview for job.My question is taken from Variable Argument Lists topic in chapter C Library of C |
|
Answer» The correct OPTION is (d) va_start |
|
| 82. |
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 fileThis question was addressed to me in homework.My question is from Diagnostics in section C Library of C |
|
Answer» Right OPTION is (a) STANDARD error file |
|
| 83. |
A domain error occurs if x is negative and y is not an integral value for the function pow(double x, double y).(a) true(b) falseThis question was posed to me during a job interview.Enquiry is from Mathematical functions in division C Library of C |
|
Answer» The CORRECT answer is (a) true |
|
| 84. |
The header file stdarg.h defines a variable type ________(a) va_list(b) v_list(c) size_t(d) var_listThe question was asked during an interview.This is a very interesting question from Variable Argument Lists topic in chapter C Library of C |
|
Answer» Correct OPTION is (a) va_list |
|
| 85. |
The C library function _____________function converts the wide character to its multibyte representation.(a) mblen()(b) mbtowc()(c) wcstombs()(d) wctomb()This question was posed to me in semester exam.Enquiry is from General Utilities topic in division C Library of C |
|
Answer» Right option is (d) wctomb() |
|
| 86. |
What is the name of the function that is used to convert multibyte character to wide character?(a) mblen()(b) mbtowc()(c) mbstowcs()(d) wcstombs()The question was asked in homework.Query is from General Utilities topic in division C Library of C |
|
Answer» CORRECT option is (b) mbtowc() Explanation: mbtowc() FUNCTION is used to convert the multibyte CHARACTER to WIDE character. |
|
| 87. |
What is the function of the void *realloc(void *str, size-t size);?(a) allocates space for an array of str objects, each of whose size is size(b) allocates space for an object whose size is specified by size and whose value is indeterminate(c) changes the size of the object pointed to by str to the size specified by size(d) causes the space pointed to by str to be deallocated, that is, made available for further allocationThis question was addressed to me during an interview.My question is from General Utilities in chapter C Library of C |
|
Answer» Correct answer is (c) CHANGES the size of the object pointed to by STR to the size SPECIFIED by size |
|
| 88. |
______ macro must be called before using ______ and ________(a) va_arg, va_end and va_start(b) va_start, va_end and va_arg(c) va_end, va_arg and va_start(d) v_arg, v_end and v_startThe question was posed to me at a job interview.This question is from Variable Argument Lists topic in portion C Library of C |
|
Answer» Correct choice is (B) va_start, va_end and va_arg |
|
| 89. |
The _______ function sorts an array of objects.(a) bsort()(b) hsort()(c) ssort()(d) qsort()The question was asked in an internship interview.This intriguing question comes from General Utilities in division C Library of C |
|
Answer» The correct choice is (d) qsort() |
|
| 90. |
A function is declared as sqrt(-x) under the header file math.h, what will the function return?(a) square root of x(b) complex number(c) domain error(d) range errorI got this question during an interview.This interesting question is from Mathematical functions topic in division C Library of C |
|
Answer» CORRECT answer is (c) domain error Explanation: double SQRT (double x); The sqrt function computes the nonnegative SQUARE root of x. A domain error occurs if the argument is negative. |
|
| 91. |
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 patternThe question was posed to me in an online interview.This question is from Diagnostics in chapter C Library of C |
|
Answer» Correct CHOICE is (C) assert returns NOTHING |
|
| 92. |
Which function converts the wide-character string to a multibyte string?(a) wcstombs()(b) mbstowcs()(c) mbtowc()(d) mblen()This question was posed to me during an interview.This intriguing question originated from General Utilities topic in portion C Library of C |
|
Answer» Correct option is (a) wcstombs() |
|
| 93. |
The pointer used in the mblen() function points to the _________(a) first byte of multibyte character(b) last byte of multibyte character(c) middle byte of multibyte character(d) no pointer is used in mblen functionThis question was addressed to me in an online quiz.This interesting question is from General Utilities topic in chapter C Library of C |
|
Answer» RIGHT choice is (a) FIRST byte of multibyte character Best explanation: The PROTOTYPE of the functon mblen() is int mblen(const char *s,size_t N); The POINTER ‘s’ points to the first byte of the multibyte character. |
|
| 94. |
The ________ function returns no value.(a) malloc()(b) realloc()(c) free()(d) calloc()This question was addressed to me by my school teacher while I was bunking the class.My question comes from General Utilities in section C Library of C |
|
Answer» The correct option is (c) free() |
|
| 95. |
Which among the given function does not return a value?(a) strtoul()(b) strtol()(c) rand()(d) srand()The question was asked in semester exam.My question is taken from General Utilities in division C Library of C |
|
Answer» Right OPTION is (d) srand() |
|
| 96. |
The calloc() function allocates space for an array of n objects, each of whose size is defined by size. Space is initialized to all bits zero.(a) true(b) falseI had been asked this question in class test.The origin of the question is General Utilities in portion C Library of C |
|
Answer» The correct option is (a) true |
|
| 97. |
If the result overflows, the function returns the value of the macro HUGE_VAL, carrying the same sign except for the _________ function as the correct value of the function.(a) sin(b) cos(c) cosec(d) tanI have been asked this question by my school teacher while I was bunking the class.My enquiry is from Mathematical Functions in division C Library of C |
|
Answer» Correct choice is (d) TAN |
|
| 98. |
What error occurs if an input argument is outside the domain over which the mathematical function is defined?(a) domain error(b) range error(c) no error(d) domain and range errorThe question was posed to me by my college professor while I was bunking the class.My question is from Mathematical Functions topic in portion C Library of C |
|
Answer» Correct option is (a) DOMAIN ERROR |
|
| 99. |
HUGE_VAL macro is used when the output of the function may not be ___________(a) floating point numbers(b) integer number(c) short int(d) long intThe question was posed to me in an online interview.I'd like to ask this question from Mathematical Functions in division C Library of C |
|
Answer» Right option is (a) floating POINT numbers |
|
| 100. |
Which statement is true regarding abs() and labs()?(a) The abs() function is similar to the labs() function, except that the argument and the returned value each of them have type long int(b) The abs() function is not similar to the labs() function, except that the argument and the returned value in both functions have type long int(c) The abs() function is similar to the labs() function, except that the argument and the returned value each have type short int(d) The abs() function is not similar to the labs() function, except that the argument and the returned value in both function have type short intThe question was asked by my school teacher while I was bunking the class.My question is from General Utilities in portion C Library of C |
|
Answer» The correct answer is (a) The ABS() FUNCTION is similar to the labs() function, except that the argument and the RETURNED value each of them have type LONG INT |
|