Test Series - cpp

Test Number 94/102

Q: Which operator is used for input stream?
A. >
B. >>
C. <
D. <<
Solution: The operator of extraction is >> and it is used on the standard input stream.
Q: 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 <
Solution: cin will stop its extraction when it encounters a blank space.
Q: Which is used to get the input during runtime?
A. cout
B. cin
C. coi
D. cinout
Solution: cin is mainly used to get the input during the runtime.
Q: What can be used to input a string with blank space?
A. inline
B. getline
C. putline
D. setline
Solution: If a user wants to input a sentence with blank spaces, then he may use the function getline.
Q: When will the cin can start processing of input?
A. After pressing return key
B. BY pressing blank space
C. After pressing return key & BY pressing blank space
D. BY pressing delete space
Solution: When you give some input to console the processing of the input starts when the user presses enter/return key.
Q: Which is used for formatting purpose in c++?
A. Whitespace
B. Container
C. &
D. Vector
Solution: Whitespace is a term that refers to characters like spaces, tabs, and newlines that are used for formatting purposes.
Q: How many number of spaces should be set in default tab?
A. 1
B. 2
C. 3
D. 4
Solution: The default number of spaces is 4 in programming.
Q: What can be improved by formatting the source code?
A. Memory
B. Address
C. User interface
D. Iterator
Solution: By formatting your code, the user can easily understand it and can upgrade it without any complexity.
Q: Which function allows you to set minimum width for the next input?
A. setfill
B. setw
C. setwidth
D. setheight
Solution: setw function of iomanip header file allows you to set minimum width for the next input.
Q: What is the use of the function "showbase"?
A. Indicate the base used
B. Indicate the variable
C. Indicate the base used & variable
D. Indicate the derived
Solution: showbase is used to indicate the base used.

You Have Score    /10