

MCQOPTIONS
This section includes 93 Mcqs, each offering curated multiple-choice questions to sharpen your Strings knowledge and support exam preparation. Choose a topic below to get started.
1. |
What will be the output of the program ?
|
A. | Suresh, Siva, Sona, Baiju, Ritu |
B. | Suresh, Siva, Sona, Ritu, Baiju |
C. | Suresh, Siva, Baiju, Sona, Ritu |
D. | Suresh, Siva, Ritu, Sona, Baiju |
Answer» C. Suresh, Siva, Baiju, Sona, Ritu | |
2. |
What will be the output of the program ?
|
A. | 10 |
B. | 6 |
C. | 5 |
D. | 11 |
Answer» D. 11 | |
3. |
What will be the output of the program ?
|
A. | Error |
B. | IndiaBIX |
C. | Cannot predict |
D. | |
Answer» D. | |
4. |
What will be the output of the program If characters 'a', 'b' and 'c' enter are supplied as input?
|
A. | abc abc |
B. | bca |
C. | Infinite loop |
D. | cba |
Answer» E. | |
5. |
What will be the output of the program ?
|
A. | Error |
B. | India BIX |
C. | India |
D. | BIX |
Answer» D. BIX | |
6. |
What will be the output of the program ?
|
A. | BIX |
B. | India |
C. | India BIX |
D. | India 0BIX |
Answer» C. India BIX | |
7. |
What will be the output of the program ?
|
A. | 6 |
B. | 12 |
C. | 7 |
D. | 2 |
Answer» B. 12 | |
8. |
What will be the output of the program ?
|
A. | Good Morning |
B. | Good |
C. | M |
D. | Morning |
Answer» E. | |
9. |
What will be the output of the program ?
|
A. | A |
B. | a |
C. | c |
D. | 65 |
Answer» B. a | |
10. |
What will be the output of the program ?
|
A. | Hello |
B. | World |
C. | Hello World |
D. | WorldHello |
Answer» D. WorldHello | |
11. |
What is the output of following program?
|
A. | n1 = 10, n2 = 9 |
B. | n1 = 10, n2 = 10 |
C. | n1 = 9, n2 = 9 |
D. | n1 = 9, n2 = 10 |
Answer» B. n1 = 10, n2 = 10 | |
12. |
What will be the output of the program ?
|
A. | Unpredictable integer value |
B. | -1 |
C. | Error |
Answer» B. -1 | |
13. |
What will be the output of the program ?
|
A. | The string is not empty |
B. | The string is empty |
C. | No output |
Answer» C. No output | |
14. |
If the size of pointer is 4 bytes then What will be the output of the program ?
|
A. | 22, 4 |
B. | 25, 5 |
C. | 24, 5 |
D. | 20, 2 |
Answer» D. 20, 2 | |
15. |
What will be the output of the program (Turbo C in 16 bit platform DOS) ?
|
A. | IndiaBIX India |
B. | IndiaBIX IndiaBIX |
C. | India India |
D. | Error |
Answer» C. India India | |
16. |
What will be the output of the program ?
|
A. | The sentence will get printed in same order as it entered |
B. | The sentence will get printed in reverse order |
C. | Half of the sentence will get printed |
D. | None of above |
Answer» C. Half of the sentence will get printed | |
17. |
What will be the output of the program ?
|
A. | Error |
B. | IndiaBIX |
C. | BIX |
D. | None of above |
Answer» D. None of above | |
18. |
What will be the output of the program ?
|
A. | Kagpur, Kanpur |
B. | Nagpur, Kanpur |
C. | Kagpur, anpur |
D. | Error |
Answer» E. | |
19. |
What will be the output of the program ?
|
A. | Error |
B. | IndiaBIX |
C. | Base address of str |
D. | No output |
Answer» B. IndiaBIX | |
20. |
What will be the output of the program ?
|
A. | Garbage value |
B. | Error |
C. | No output |
D. | diaBIX |
Answer» B. Error | |
21. |
What will be the output of the program ?
|
A. | Hello |
B. | HelloHello |
C. | No output |
D. | ello |
Answer» B. HelloHello | |
22. |
What will be the output of the program ?
|
A. | 10 |
B. | 6 |
C. | 5 |
D. | 11 |
Answer» E. | |
23. |
What will be the output of the program ?
|
A. | t, t |
B. | k, k |
C. | n, k |
D. | m, f |
Answer» C. n, k | |
24. |
What will be the output of the program ?
|
A. | The string is empty |
B. | The string is not empty |
C. | No output |
Answer» C. No output | |
25. |
If char=1, int=4, and float=4 bytes size, What will be the output of the program ?
|
A. | 1, 2, 4 |
B. | 1, 4, 4 |
C. | 2, 2, 4 |
D. | 2, 4, 8 |
Answer» C. 2, 2, 4 | |
26. |
What will be the output of the program in 16-bit platform (Turbo C under DOS) ?
|
A. | 8, 1, 4 |
B. | 4, 2, 8 |
C. | 4, 2, 4 |
D. | 10, 3, 4 |
Answer» C. 4, 2, 4 | |
27. |
What will be the output of the following C code?
|
A. | Before memmove place= string1, src = string2 After memmove place = string2, src = string2 |
B. | Before memmove place = string2, src = string2 After memmove place= string1, src = string2 |
C. | Before memmove place = string2, src = string1 After memmove place= string2, src =string2 |
D. | Before memmove place= string1, src = string2 After memmove place=string1, src = string1 |
Answer» B. Before memmove place = string2, src = string2 After memmove place= string1, src = string2 | |
28. |
Assume that a character takes 1 byte. Output of following program?
|
A. | 9 |
B. | 10 |
C. | 20 |
D. | Garbage Value |
Answer» D. Garbage Value | |
29. |
Output of following program
|
A. | gekskeg |
B. | geeksskeeg |
C. | geeks |
D. | Garbage Values |
Answer» B. geeksskeeg | |
30. |
Predict the output of the following program:
|
A. | G Q |
B. | 71 81 |
C. | 71 Q |
D. | Compile-time error |
Answer» D. Compile-time error | |
31. |
Output?
|
A. | Compiler Error |
B. | geeksquiz followed by garbage characters |
C. | geeksquiz |
D. | Runtime Error |
Answer» D. Runtime Error | |
32. |
#include
|
A. | GeeksQuiz |
B. | geeksquiz |
C. | Compiler dependent |
Answer» D. | |
33. |
In below program, what would you put in place of ? to print Quiz ?
|
A. | arr |
B. | (arr+5) |
C. | (arr+4) |
D. | Not possible |
Answer» C. (arr+4) | |
34. |
What does the following fragment of C-program print?
|
A. | GATE2011 |
B. | E2011 |
C. | 2011 |
D. | 011 |
Answer» D. 011 | |
35. |
Predict the output?
|
A. | 10 |
B. | 9 |
C. | 8 |
D. | Random Number |
Answer» C. 8 | |
36. |
What is the output of following program?
|
A. | str1 is Quiz, str2 is Geeks |
B. | str1 is Geeks, str2 is Quiz |
C. | |
D. | D. |
E. | |
Answer» C. | |
37. |
NULL is the macro defined in the header string. h. |
A. | true |
B. | false |
Answer» B. false | |
38. |
Which of the following is the variable type defined in header string. h? |
A. | sizet |
B. | size |
C. | size_t |
D. | size-t |
Answer» D. size-t | |
39. |
What is the function of strcoll()? |
A. | compares the string, result is dependent on the LC_COLLATE |
B. | copies the string, result is dependent on the LC_COLLATE |
C. | compares the string, result is not dependent on the LC_COLLATE |
D. | copies the string, result is not dependent on the LC_COLLATE |
Answer» B. copies the string, result is dependent on the LC_COLLATE | |
40. |
The ______ function appends not more than n characters. |
A. | strcat() |
B. | strcon() |
C. | strncat() |
D. | memcat() |
Answer» D. memcat() | |
41. |
What is the prototype of strcoll() function? |
A. | int strcoll(const char *s1,const char *s2) |
B. | int strcoll(const char *s1) |
C. | int strcoll(const *s1,const *s2) |
D. | int strcoll(const *s1) |
Answer» B. int strcoll(const char *s1) | |
42. |
What will strcmp() function do? |
A. | compares the first n characters of the object |
B. | compares the string |
C. | undefined function |
D. | copies the string |
Answer» C. undefined function | |
43. |
Which function will you choose to join two words? |
A. | strcpy() |
B. | strcat() |
C. | strncon() |
D. | memcon() |
Answer» C. strncon() | |
44. |
Which among the following is Copying function? |
A. | memcpy() |
B. | strcopy() |
C. | memcopy() |
D. | strxcpy() |
Answer» B. strcopy() | |
45. |
#include
|
A. | sizeof(str1) = 10, sizeof(str2) = 10 |
B. | sizeof(str1) = 4, sizeof(str2) = 10 |
C. | sizeof(str1) = 4, sizeof(str2) = 4 |
D. | sizeof(str1) = 10, sizeof(str2) = 4 |
Answer» C. sizeof(str1) = 4, sizeof(str2) = 4 | |
46. |
Functions whose names begin with strn |
A. | manipulates sequences of arbitrary characters |
B. | manipulates null-terminated sequences of characters |
C. | manipulates sequence of non null characters. |
D. | returns a pointer to the token |
Answer» D. returns a pointer to the token | |
47. |
What will be the output of the following C code?
|
A. | g |
B. | a |
C. | h |
D. | f |
Answer» E. | |
48. |
What will be the output of the following C code?
|
A. | 6 |
B. | 5 |
C. | 4 |
D. | no match |
Answer» C. 4 | |
49. |
Which of the following is the right syntax to copy n characters from the object pointed to by s2 into the object pointed to by s1? |
A. | void *memcpy(void *s1,const void *s2,size_t n); |
B. | void *memcpy(void *s2, const void *s1, size_t n); |
C. | void memcpy(void *s1,const void *s2, size_t n); |
D. | void memcpy(void *s2,const void *s1,size_t n); |
Answer» B. void *memcpy(void *s2, const void *s1, size_t n); | |
50. |
What is the function of void *memset(s, c, n)? |
A. | places character s into first n characters of c, return c |
B. | places character c into first n characters of s, return s |
C. | places character s into first n characters of c, return s |
D. | places character c into first n character of s, return c |
Answer» C. places character s into first n characters of c, return s | |