C Program MCQ
Test your knowledge with important C Program MCQ and their applications. These MCQs are beneficial for competitive exams too. Explore 30+ more C Program MCQs on Bissoy. Bissoy App
-
The abs() function computes the absolute value . . . . . . . .
-
The macro . . . . . . . . defines the number of bits in a byte, which is equal to . . . . . . . .
-
If setjmp() macro returns directly from the macro invocation, it . . . . . . . .
-
The void longjmp( jmp-buf env, int val) function causes setjmp() macro to return . . . . . . . . value; if val is 0.
-
Point out the error (if any) in the following C code?<br><pre><code class="c-program">#include <stdlib.h>#include <stdio.h>int main(void){ int* p = NULL; struct S *s = NULL; void(*f)(int, double) = NULL; char *ptr = malloc(15); if (ptr == NULL) printf("Out of memory"); free(ptr);}</code></pre>
-
. . . . . . . . macro must be called before using . . . . . . . . and . . . . . . . .
-
The three macros defined by stdarg.h is . . . . . . . .
-
The value of tm_isdst is . . . . . . . . when DST( Daylight Savings Time) is in effect, . . . . . . . . when DST is not in effect and . . . . . . . . when the DST status is unknown.
-
Initial seed is . . . . . . . . for the function srand(unsigned int seed).
-
Which of the following statement is correct?<br><pre><code class="c-program">double x, y, z;x = 5.123456;z= modf(x, *y);</code></pre>
-
Is this right explanation to the given code?<br><pre><code class="c-program">void *calloc(size_t n, size_t size) #n -- This is the number of elements to be allocated.#size -- This is the size of elements.</code></pre>
-
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.
-
The . . . . . . . . function returns no value.
-
The system() function passes the string pointed to by string to the host environment to be executed by a command processor in an implementation-defined manner.<br><pre><code class="c-program">int system(const char *string);</code></pre>
-
The . . . . . . . . function sorts an array of objects.
-
When we use multiple alignas specifiers in the same declaration, the . . . . . . . . one is used.
-
What will the following C statement do?<br><pre><code class="c-program">#include < setjmp.h >int setjmp(jmp_buf env);</code></pre>
-
If NDEBUG is defined as a macro name, at the point where <assert.h> is included, then assert macro is defined as #define assert(ignore) ((void)0).
-
The assert macro returns . . . . . . . . value.
-
If access to the varying arguments is desired then the called function shall declare . . . . . . . . having type va_list.
-
The value of CHAR_MAX will be equal to SCHAR_MAX when . . . . . . . .
-
The purpose of the function ctime() is that . . . . . . . .
-
HUGE_VAL macro is used when the output of the function may not be . . . . . . . .
-
The value returned by the library function mktime(), on failure is . . . . . . . .
-
What is the purpose of the given C code?<br><pre><code class="c-program">#include <stdlib.h> _Mbsave _Mbxtowc = {0}; int (mbtowc) (wchar_t *pwc, const char *a, size_t n) {return (-Mbtowc (pwc, s, n, &-Mbxtowc) ) ;}</code></pre>
-
What is the meaning of the following C code if output is 0?<br><pre><code class="c-program">#include<stdio.h>#include<time.h>int main(){ struct tm *local; time_t t; t=time(NULL); local=localtime(&t); printf("%d",local->tm_isdst); return 0;}</code></pre>
-
void free(void *ptr) deallocates the memory previously allocated by a call to . . . . . . . . , . . . . . . . . or . . . . . . . .
-
To find the maximum value of an object of type unsigned long long int, we use the macro . . . . . . . .
-
What is "a" in the given C code?<br><pre><code class="c-program">size_t wcstombs(char *s, const wchar_t *a, size_t n)</code></pre>
-
The assert shall be implemented as a . . . . . . . . not as an actual . . . . . . . .