Explore topic-wise MCQs in Testing Subject.

This section includes 657 Mcqs, each offering curated multiple-choice questions to sharpen your Testing Subject knowledge and support exam preparation. Choose a topic below to get started.

1.

Select the macro that affects the information provided by localeconv function.

A. LC_ALL
B. LC_COLLATE
C. LC_NUMERIC
D. LC_CTYPE
Answer» D. LC_CTYPE
2.

What is returned by the function localeconv()?

A. current location value
B. past location value
C. pointer to the last location
D. pointer to the current location
Answer» E.
3.

sqrt(x) function is not faster than the apparent equivalent pow(x,0.5).

A. true
B. false
Answer» C.
4.

The macro which is used to find the maximum value of an unsigned integer is _________

A. UNINT_MAX
B. UNSINT_MAX
C. UINT_MAX
D. UNIT_MAX
Answer» D. UNIT_MAX
5.

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 error
Answer» B. range error
6.

Which of the following macros is defined under the header limits.h?

A. FLT_ROUNDS
B. USHRT_MAX
C. DBL_MAX
D. DECIMAL_DIG
Answer» C. DBL_MAX
7.

mblen() function returns 0,if a null wide character was recognized. It returns -1 if an invalid multi-byte sequence was encountered.

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

The macro definition of INT_MIN is ____________

A. -INT_MAX – 1
B. INT_MAX – 1
C. -INT_MAX + 1
D. INT_MAX + 1
Answer» B. INT_MAX – 1
9.

A type whose alignment requirement is at least as large as that of every data type:

A. max_align_t
B. ptrdiff_t
C. size_t
D. nULL
Answer» E.
10.

Which function is used to recombine the fraction and exponent parts of a floating-point value after you have worked on them separately?

A. frexp()
B. exp()
C. modf()
D. Idexp()
Answer» E.
11.

Which of the following functions returns a pointer to a string representing the date and time stored in a structure?

A. ctime()
B. time()
C. asctime()
D. localtime()
Answer» D. localtime()
12.

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
13.

Which of the following library functions returns the time in UTC (Greenwich mean time) format?

A. localtime()
B. gettime()
C. gmtime()
D. settime()
Answer» D. settime()
14.

Which of the following header declares mathematical functions and macros?

A. math.h
B. assert.h
C. stdmat. h
D. stdio. h
Answer» B. assert.h
15.

The macro offset expands to a constant of type __________________

A. size_t
B. print_t
C. ptrdiff_t
D. nULL
Answer» B. print_t
16.

double______(double x, double y) computes the floating-point remainder of x/y.

A. modf
B. fmod
C. ceil
D. floor
Answer» C. ceil
17.

What are the contents of the register?

A. sp, fp only
B. sp only
C. fp, pc only
D. sp, fp, pc
Answer» E.
18.

When we use multiple alignas specifiers in the same declaration, the ____________ one is used.

A. first
B. strictest
C. last
D. middle
Answer» C. last
19.

Initial seed is ________ for the function srand(unsigned int seed).

A. 0
B. 1
C. 0
D. 1
Answer» C. 0
20.

Which header file should be included if a function has to be defined such that it can accept variable number of arguments?

A. stdlib.h
B. stdarg.h
C. assert.h
D. setjmp.h
Answer» C. assert.h
21.

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. false
Answer» B. false
22.

Which of the following format specifiers is used to represent the hours in the 24 hour clock (0-23) format?

A. %I
B. %H
C. %i
D. %h
Answer» C. %i
23.

The value returned by the library function mktime(), on failure is:

A. -1
B. 0
C. 1
D. -2
Answer» B. 0
24.

To find the maximum value of an object of type unsigned long long int, we use the macro _________

A. ULINT_MAX
B. ULLINT_MAX
C. ULONG_MAX
D. ULLONG_MAX
Answer» E.
25.

Which of the given function is a library function under the header math.h?

A. log10()
B. log20()
C. log30()
D. log50()
Answer» B. log20()
26.

The header file setjmp.h is used to

A. set location specific information
B. control low-level calls and returns to and from functions
C. handle signals reported during a program's execution
D. manipulate strings (character arrays)
Answer» C. handle signals reported during a program's execution
27.

Which function returns the arc sine in the range [-pi/2, +pi/2] radians?

A. arcsin()
B. asin()
C. sin()
D. asine()
Answer» C. sin()
28.

The mbstowcs() function is used to return the number of array elements modified, not including a terminating zero code, if any.

A. true
B. false
Answer» B. false
29.

MB_CUR_MAX is not defined in stdlib.h.

A. true
B. false
Answer» C.
30.

The header file assert.h of the C Standard Library defines ________macro.

A. stderr
B. stdarg
C. setjmp
D. assert
Answer» E.
31.

The purpose of the function ctime() is that ___________

A. it returns a string representing the local time
B. it returns a void string
C. it returns a string representing the time in UTC format
D. it returns a string representing the time stored in a structure
Answer» B. it returns a void string
32.

The library function clock() returns the number of _________ elapsed since the start of the program.

A. minutes
B. clock ticks
C. milli-seconds
D. micro-seconds
Answer» C. milli-seconds
33.

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 function
Answer» B. last byte of multibyte character
34.

What will function gcvt() do?

A. Convert vector to integer value
B. Convert floating-point number to a string
C. Convert 2D array in to 1D array.
D. Covert multi Dimensional array to 1D array
Answer» C. Convert 2D array in to 1D array.
35.

What will be the output of the program? #include int main() { int i; char c; for(i=1; i

A. aaaa
B. aaaaa
C. Garbage value.
D. Error in ungetc statement.
Answer» C. Garbage value.
36.

If the two strings are found to be unequal then strcmp returns difference between the first non-matching pair of characters.

A. 1
B.
Answer» B.
37.

What will be the output of the program? #include #include int main() { char *i = "55.555"; int result1 = 10; float result2 = 11.111; result1 = result1+atoi(i); result2 = result2+atof(i); printf("%d, %f", result1, result2); return 0; }

A. 55, 55.555
B. 66, 66.666600
C. 65, 66.666000
D. 55, 55
Answer» D. 55, 55
38.

FILE is a structure suitably typedef'd in "stdio.h".

A. 1
B.
Answer» B.
39.

Will the program outputs "IndiaBIX.com"? #include #include int main() { char str1[] = "IndiaBIX.com"; char str2[20]; strncpy(str2, str1, 8); printf("%s", str2); return 0; }

A. Yes
B. No
Answer» C.
40.

Can you use the fprintf() to display the output on the screen?

A. Yes
B. No
Answer» B. No
41.

ftell() returns the current position of the pointer in a file stream.

A. 1
B.
Answer» B.
42.

Point out the error in the following program. #include int main() { char str[] = "IndiaBIX"; printf("%.#s %2s", str, str); return 0; }

A. Error: in Array declaration
B. Error: printf statement
C. Error: unspecified character in printf
D. No error
Answer» E.
43.

What will be the output of the program? #include #include int main() { char dest[] = {97, 97, 0}; char src[] = "aaa"; int i; if((i = memcmp(dest, src, 2))==0) printf("Got it"); else printf("Missed"); return 0; }

A. Missed
B. Got it
C. Error in memcmp statement
D. None of above
Answer» C. Error in memcmp statement
44.

The prototypes of all standard library string functions are declared in the file string.h.

A. Yes
B. No
Answer» B. No
45.

What will be the output of the program? #include #include int main() { float i = 2.5; printf("%f, %d", floor(i), ceil(i)); return 0; }

A. 2, 3
B. 2.000000, 3
C. 2.000000, 0
D. 2, 0
Answer» D. 2, 0
46.

Data written into a file using fwrite() can be read back using fscanf()

A. 1
B.
Answer» C.
47.

Point out the error in the following program. #include #include int main() { char str1[] = "Learn through IndiaBIX\0.com", str2[120]; char *p; p = (char*) memccpy(str2, str1, 'i', strlen(str1)); *p = '\0'; printf("%s", str2); return 0; }

A. Error: in memccpy statement
B. Error: invalid pointer conversion
C. Error: invalid variable declaration
D. No error and prints "Learn through Indi"
Answer» E.
48.

What will be the output of the program? #include int main() { int i; i = scanf("%d %d", &i, &i); printf("%d\n", i); return 0; }

A. 1
B. 2
C. Garbage value
D. Error: cannot assign scanf to variable
Answer» C. Garbage value
49.

What will be the output of the program? #include int main() { int i; char c; for(i=1; i

A. bbbb
B. bbbbb
C. b
D. Error in ungetc statement.
Answer» D. Error in ungetc statement.
50.

scanf() or atoi() function can be used to convert a string like "436" in to integer.

A. Yes
B. No
Answer» B. No