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.
| 1. |
What is the return type open() method?(a) int(b) char(c) bool(d) floatI got this question by my school principal while I was bunking the class.I want to ask this question from File Handling topic in chapter Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct OPTION is (c) bool |
|
| 2. |
What is the use of accumulate function in a numeric library?(a) Returns the number(b) Returns the result of accumulating all the values in the range(c) Returns the number & result(d) Return the charactersThis question was addressed to me in semester exam.This intriguing question comes from Generalized Numeric Algorithms topic in division Strings, Streams & Numerics in C++ of C++ |
|
Answer» The CORRECT choice is (b) RETURNS the result of ACCUMULATING all the VALUES in the RANGE |
|
| 3. |
With which does the trigonometric functions work with angles in c++?(a) Degrees(b) Radians(c) Both Degrees & Radians(d) CelsiusThe question was posed to me during an internship interview.My question is from Standard Mathematical Functions in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» Correct OPTION is (B) RADIANS |
|
| 4. |
What kind of locale does every program is having in C++?(a) local locale(b) global locale(c) temp locale(d) set localeThis question was addressed to me during an interview for a job.Question is taken from Locale topic in portion Strings, Streams & Numerics in C++ of C++ |
|
Answer» CORRECT option is (B) global LOCALE To explain I would say: Every program has a SINGLE locale object which is its global locale. |
|
| 5. |
How many tests are available in read and write operations?(a) 1(b) 2(c) 3(d) 4This question was addressed to me by my college director while I was bunking the class.This key question is from Buffering in chapter Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct option is (b) 2 |
|
| 6. |
Where are the strings stored?(a) Stack(b) Heap(c) Both Stack & Heap(d) QueueThis question was addressed to me in a job interview.This intriguing question comes from String Characters topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» Right option is (c) Both Stack & Heap |
|
| 7. |
Which of the following is not used to seek file pointer?(a) ios::set(b) ios::end(c) ios::cur(d) ios::begThis question was posed to me in class test.My enquiry is from File Handling in division Strings, Streams & Numerics in C++ of C++ |
|
Answer» Correct choice is (a) ios::SET |
|
| 8. |
What is the main feature of locale in C++?(a) Sustainability(b) Portability(c) Reliability(d) Sustainability & ReliabilityThis question was posed to me in a national level competition.Origin of the question is Locale topic in division Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct option is (b) Portability |
|
| 9. |
Which of the following have their changes in their declaration related to constness of parameter?(a) strchr(b) string(c) memory(d) strcybrkThis question was addressed to me in an online quiz.I'm obligated to ask this question of C Standard Library topic in portion Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct choice is (a) strchr |
|
| 10. |
How does the strings are stored in the memory?(a) Contiguous(b) Non-contiguous(c) Null(d) sequenceI had been asked this question by my college professor while I was bunking the class.Question is from String Characters topic in chapter Strings, Streams & Numerics in C++ of C++ |
|
Answer» The CORRECT ANSWER is (a) Contiguous |
|
| 11. |
Which of the following library is used to do vector arithmetic?(a) Boost(b) Time(c) OpenGL(d) OpenDLThe question was posed to me in an interview.I want to ask this question from Vector Arithmetic in portion Strings, Streams & Numerics in C++ of C++ |
|
Answer» Right CHOICE is (a) BOOST |
|
| 12. |
Where does the member should be defined if it is used in the program?(a) Namespace scope(b) Character scope(c) Namespace & Character scope(d) Directional scopeI have been asked this question in an interview for job.I'm obligated to ask this question of Numeric Limits topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct choice is (a) NAMESPACE scope |
|
| 13. |
What can be used to input a string with blank space?(a) inline(b) getline(c) putline(d) setlineI had been asked this question at a job interview.This intriguing question comes from Input Stream in portion Strings, Streams & Numerics in C++ of C++ |
|
Answer» RIGHT choice is (b) GETLINE Explanation: If a USER wants to input a sentence with blank spaces, then he may USE the function getline. |
|
| 14. |
How many groups of output of operation are there in c++?(a) 1(b) 2(c) 3(d) 4I have been asked this question in final exam.Origin of the question is Output Stream topic in division Strings, Streams & Numerics in C++ of C++ |
|
Answer» CORRECT OPTION is (b) 2 Best explanation: There are two GROUPS of output OPERATION in c++. They are formatted output and UNFORMATTED output. |
|
| 15. |
Which of the following is used to create a stream that performs both input and output operations?(a) ofstream(b) ifstream(c) iostream(d) fstreamThis question was posed to me in class test.This intriguing question comes from File Handling in chapter Strings, Streams & Numerics in C++ of C++ |
|
Answer» Right choice is (d) fstream |
|
| 16. |
Which function is used to optimize the space in vector?(a) at(b) bool(c) operator(d) operandI had been asked this question by my school principal while I was bunking the class.This question is from Vector Arithmetic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» The CORRECT answer is (b) bool |
|
| 17. |
How many types of output stream classes are there in c++?(a) 1(b) 2(c) 3(d) 4This question was addressed to me during an internship interview.I need to ask this question from Output Stream topic in portion Strings, Streams & Numerics in C++ of C++ |
|
Answer» Right OPTION is (C) 3 |
|
| 18. |
What is the difference between unsigned int length() and unsigned int size()?(a) Returns a different value(b) They are same(c) Returns a different value but they are same(d) Returns a lengthI have been asked this question in homework.This interesting question is from Basic String topic in division Strings, Streams & Numerics in C++ of C++ |
|
Answer» Correct ANSWER is (b) They are same |
|
| 19. |
How many objects are used for input and output to a string?(a) 1(b) 2(c) 3(d) 4This question was addressed to me during an interview.Question is from File Streams and String Streams topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» Right choice is (C) 3 |
|
| 20. |
Which is an instantiation of the basic_string class template?(a) Character(b) String class(c) Memory(d) IteratorThis question was posed to me by my college director while I was bunking the class.I want to ask this question from String Characters in chapter Strings, Streams & Numerics in C++ of C++ |
|
Answer» RIGHT ANSWER is (b) STRING class To EXPLAIN I would say: The string class is an instantiation of the basic_string class template. |
|
| 21. |
How many streams are automatically created when executing a program?(a) 1(b) 2(c) 3(d) 4I got this question in an interview for job.This question is from C Input Output topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct option is (c) 3 |
|
| 22. |
Which header file is used with input and output operations of C in C++?(a) stdio.h(b) cstdio(c) iostream(d) streamioI got this question during a job interview.This interesting question is from C Input Output topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» Right option is (B) cstdio |
|
| 23. |
Where does a cin stops it extraction of data?(a) By seeing a blank space(b) By seeing ((c) By seeing a blank space & ((d) By seeing |
|
Answer» Right OPTION is (a) By seeing a blank SPACE |
|
| 24. |
Which of the following is not used as a file opening mode?(a) ios::trunc(b) ios::binary(c) ios::in(d) ios::ateI have been asked this question in an online interview.My doubt stems from File Handling topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» Right option is (a) ios::TRUNC |
|
| 25. |
How many categories are available in facets?(a) 4(b) 5(c) 6(d) 3I got this question in an online interview.The question is from Locale topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct option is (c) 6 |
|
| 26. |
What is meant by ofstream in c++?(a) Writes to a file(b) Reads from a file(c) Writes to a file &Reads from a file(d) delete a fileThis question was posed to me in an interview.The question is from Output Stream topic in chapter Strings, Streams & Numerics in C++ of C++ |
|
Answer» RIGHT option is (a) WRITES to a file Easy EXPLANATION - OFSTREAM is a stream class to write on FILES. |
|
| 27. |
Which function is used in C++ to get the current position of file pointer in a file?(a) tell_p()(b) get_pos()(c) get_p()(d) tell_pos()I had been asked this question in an interview.This intriguing question comes from File Handling in portion Strings, Streams & Numerics in C++ of C++ |
|
Answer» Right option is (a) tell_p() |
|
| 28. |
By default, all the files in C++ are opened in _________ mode.(a) Text(b) Binary(c) ISCII(d) VTCI got this question in examination.The query is from File Handling in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct option is (a) TEXT |
|
| 29. |
What will act as a intermediate between i/o operations and physical file?(a) Memory(b) Ram(c) Stream buffer(d) StorageThis question was addressed to me in an interview for internship.Origin of the question is Buffering topic in division Strings, Streams & Numerics in C++ of C++ |
|
Answer» Correct answer is (c) STREAM buffer |
|
| 30. |
What will be the type of output of vector cross product?(a) Scalar(b) Vector(c) Both Scalar & Vector(d) LinearThe question was asked in an online quiz.Question is taken from Vector Arithmetic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» The CORRECT answer is (b) VECTOR |
|
| 31. |
Which of the following mathematical function is overloaded in and ?(a) cos(b) tan(c) sin(d) modI had been asked this question in an interview for job.The above asked question is from Standard Mathematical Functions in chapter Strings, Streams & Numerics in C++ of C++ |
|
Answer» The CORRECT choice is (B) tan |
|
| 32. |
Which header file is required for manipulation of math functions in c++?(a) cmath(b) maths(c) math(d) dmathThe question was asked in a job interview.This interesting question is from Standard Mathematical Functions in portion Strings, Streams & Numerics in C++ of C++ |
|
Answer» CORRECT choice is (a) cmath Explanation: #INCLUDE is a HEADER file REQUIRED for MANIPULATION of math functions. |
|
| 33. |
Where are standard C libraries defined in C++?(a) Container(b) std namespace(c) list(d) iteratorsThis question was posed to me during a job interview.I would like to ask this question from C Standard Library in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» Correct answer is (b) std NAMESPACE |
|
| 34. |
Which character is used to terminate the string?(a) $(b) Null(c) Empty(d) @This question was posed to me during an interview.Enquiry is from String Characters topic in division Strings, Streams & Numerics in C++ of C++ |
|
Answer» Right answer is (b) Null |
|
| 35. |
What type of reference should be used in vector arithmetic?(a) dynamic(b) const(c) both dynamic & const(d) staticThe question was posed to me in an international level competition.The query is from Vector Arithmetic topic in chapter Strings, Streams & Numerics in C++ of C++ |
|
Answer» Correct choice is (B) CONST |
|
| 36. |
Which header file is used to manipulate the vector algebra in c++?(a) math(b) cmath(c) vmath(d) dmathThis question was addressed to me in exam.Question is from Vector Arithmetic topic in portion Strings, Streams & Numerics in C++ of C++ |
|
Answer» The CORRECT choice is (C) vmath |
|
| 37. |
Which will be used with physical devices to interact from C++ program?(a) Programs(b) Library(c) Streams(d) IteratorsThis question was addressed to me in final exam.My question is based upon C Input Output in portion Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct CHOICE is (c) Streams |
|
| 38. |
Which one is always faster in writing on C++?(a) Writing to a file(b) Writing to memory(c) Reading from the network(d) Deleting a fileI got this question during an interview.The doubt is from Buffering in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» Correct choice is (b) Writing to MEMORY |
|
| 39. |
How many parameters are there in getline function?(a) 1(b) 2(c) 2 or 3(d) 3The question was asked by my school teacher while I was bunking the class.I'd like to ask this question from Input Stream topic in portion Strings, Streams & Numerics in C++ of C++ |
|
Answer» Correct choice is (C) 2 or 3 |
|
| 40. |
Which header file is required to use file I/O operations?(a) (b) (c) (d) I had been asked this question by my college director while I was bunking the class.My doubt is from File Handling in division Strings, Streams & Numerics in C++ of C++ |
|
Answer» RIGHT CHOICE is (C) Best explanation: |
|
| 41. |
Which mathematics library is used for vector manipulation in c++?(a) cli++(b) vec++(c) blitz++(d) stac+++I have been asked this question during an interview for a job.This interesting question is from Generalized Numeric Algorithms in portion Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct OPTION is (C) BLITZ++ |
|
| 42. |
By using which function does the buffer are automatically flushed?(a) fopen(b) copy(c) compare(d) fcloseThis question was addressed to me in an interview.This intriguing question originated from Buffering topic in division Strings, Streams & Numerics in C++ of C++ |
|
Answer» CORRECT option is (d) fclose The best I can EXPLAIN: fclose() is used to close the file and FLUSH it out of memory for safe CLOSING of FILES opened during the execution of program. In short to avoid memory faults during the execution of the program. |
|
| 43. |
Which function is used to position back from the end of file object?(a) seekg(b) seekp(c) both seekg & seekp(d) seekfI had been asked this question by my school teacher while I was bunking the class.My doubt stems from File Streams and String Streams topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» CORRECT OPTION is (a) seekg To explain: The MEMBER function seekg is used to position back from the end of FILE object. |
|
| 44. |
Which is used to get the input during runtime?(a) cout(b) cin(c) coi(d) cinoutI got this question during an online exam.My doubt stems from Input Stream in portion Strings, Streams & Numerics in C++ of C++ |
|
Answer» RIGHT option is (b) cin The EXPLANATION is: cin is MAINLY USED to get the INPUT during the runtime. |
|
| 45. |
How many elements does a floating point number is composed of?(a) 1(b) 2(c) 3(d) 4I have been asked this question in an online interview.This intriguing question originated from C Standard Library topic in chapter Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct choice is (d) 4 |
|
| 46. |
Which of the following is the default mode of the opening using the fstream class?(a) ios::in(b) ios::out(c) ios::in|ios::out(d) ios::truncThis question was posed to me during an online interview.The origin of the question is File Handling topic in chapter Strings, Streams & Numerics in C++ of C++ |
|
Answer» The CORRECT choice is (c) ios::in|ios::out |
|
| 47. |
Which of the following is the default mode of the opening using the ifstream class?(a) ios::in(b) ios::out(c) ios::app(d) ios::truncThe question was asked in exam.My query is from File Handling topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» Correct answer is (a) ios::in |
|
| 48. |
How many parameters are available in partial_sum function in c++?(a) 2(b) 3(c) 2 or 3(d) 3 or 4This question was addressed to me in quiz.The question is from Generalized Numeric Algorithms in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» The correct option is (d) 3 or 4 |
|
| 49. |
To which type does the numeric limits are suitable?(a) Character types(b) Mixed type(c) Arithmetic types(d) Relational typesI got this question in a national level competition.Query is from Numeric Limits topic in section Strings, Streams & Numerics in C++ of C++ |
|
Answer» The CORRECT option is (c) ARITHMETIC TYPES |
|
| 50. |
Which operator is used for input stream?(a) >(b) >>(c) |
|
Answer» The CORRECT choice is (B) >> |
|