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. |
How many maximum number of parameters does a string constructor can take?(a) 1(b) 2(c) 3(d) 4This question was addressed to me in an interview.This key question is from Basic String topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» CORRECT CHOICE is (c) 3 To explain: string(other_string, position, COUNT). It is a type of constructor for the string. |
|
| 52. |
Which of the following is the default mode of the opening using the ofstream class?(a) ios::in(b) ios::out(c) ios::app(d) ios::truncThe question was posed to me during an interview for a job.My question is based upon File Handling topic in division Strings, Streams & Numerics in C++ of C++ |
|
Answer» Correct OPTION is (B) ios::out |
|
| 53. |
What is the use of ios::trunc mode?(a) To open a file in input mode(b) To open a file in output mode(c) To truncate an existing file to half(d) To truncate an existing file to zeroThis question was posed to me in an internship interview.I'm obligated to ask this question of File Handling topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» Right option is (d) To TRUNCATE an existing FILE to ZERO |
|
| 54. |
Which of the following is used to create an output stream?(a) ofstream(b) ifstream(c) iostream(d) fsstreamI have been asked this question in class test.My enquiry is from File Handling in chapter Strings, Streams & Numerics in C++ of C++ |
|
Answer» Right choice is (a) ofstream |
|
| 55. |
Which operator is used to produce a certain number in a specific range?(a) $(b) %(c) modulo operator(d) both % and modulo operatorI have been asked this question in my homework.This interesting question is from Random Numbers topic in chapter Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct answer is (d) both % and MODULO OPERATOR |
|
| 56. |
Which header file is used to create the pseudo random generator?(a) random(b) cstdlib(c) rand(d) both random and cstdlibThis question was posed to me in an online quiz.My question is taken from Random Numbers topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct answer is (d) both RANDOM and cstdlib |
|
| 57. |
Which objects information is loaded in locale object?(a) facet object(b) instead object(c) Both facet & instead object(d) secant objectThis question was posed to me in exam.My question is from Locale in division Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct choice is (a) FACET object |
|
| 58. |
Which member function is used to determine whether the stream object is currently associated with a file?(a) is_open(b) buf(c) string(d) is_outThis question was addressed to me in homework.My enquiry is from File Streams and String Streams topic in division Strings, Streams & Numerics in C++ of C++ |
|
Answer» Right option is (a) is_open |
|
| 59. |
How does the limits.h header file can be represented in C++?(a) limits(b) limit(c) climits(d) dlimitsI got this question during an online interview.This intriguing question comes from C Standard Library in division Strings, Streams & Numerics in C++ of C++ |
|
Answer» Correct option is (c) climits |
|
| 60. |
How many parameters are available in srand function?(a) 1(b) 2(c) 3(d) 4This question was posed to me during an interview.My doubt stems from Random Numbers topic in chapter Strings, Streams & Numerics in C++ of C++ |
|
Answer» The CORRECT answer is (a) 1 |
|
| 61. |
Which operator is used to insert the data into file?(a) >>(b) |
|
Answer» CORRECT choice is (b) << The explanation is: You can write information to a FILE from your program using the STREAM insertion operator <<.> |
|
| 62. |
Which header file is used to operate on numeric sequences?(a) number(b) numeric(c) algorithm(d) digitI got this question in unit test.I want to ask this question from Generalized Numeric Algorithms in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» Correct CHOICE is (b) NUMERIC |
|
| 63. |
Which function is used to reposition the file pointer?(a) moveg()(b) seekg()(c) changep()(d) go_p()I had been asked this question in an interview.This interesting question is from File Handling topic in division Strings, Streams & Numerics in C++ of C++ |
|
Answer» Correct CHOICE is (b) SEEKG() |
|
| 64. |
Which is a constant defined in header file?(a) RAND_MAX(b) Rand(c) Srand(d) BlitzThis question was addressed to me in homework.Asked question is from Random Numbers topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct ANSWER is (a) RAND_MAX |
|
| 65. |
How many indicators are available in c++?(a) 4(b) 3(c) 2(d) 1The question was posed to me in semester exam.My doubt is from C Input Output topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» Right option is (B) 3 |
|
| 66. |
Pick out the correct objects about the instantiation of output stream.(a) cout(b) cerr(c) clog(d) all of the mentionedI have been asked this question in a job interview.Asked question is from Output Stream topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» Correct ANSWER is (d) all of the mentioned |
|
| 67. |
Which header file is used to manipulate the string?(a) iostream(b) iomanip(c) string(d) containerThe question was posed to me by my school teacher while I was bunking the class.The origin of the question is Basic String topic in chapter Strings, Streams & Numerics in C++ of C++ |
|
Answer» Right OPTION is (c) string |
|