Test Series - cpp

Test Number 96/102

Q: What is the main feature of locale in C++?
A. Sustainability
B. Portability
C. Reliability
D. Sustainability & Reliability
Solution: A locale is a set of features that are culture-specific, which can be used by programs to be more portable internationally.
Q: Which objects information is loaded in locale object?
A. facet object
B. instead object
C. Both facet & instead object
D. secant object
Solution: A locale object contains information about which facet objects constitute a locale, and is each one of these facet objects that implements specific features as member functions.
Q: How many categories are available in facets?
A. 4
B. 5
C. 6
D. 3
Solution: There are 6 categories of facet in c++. They are collate, ctype, monetary, numeric, time and messages.
Q: What kind of locale does every program is having in C++?
A. local locale
B. global locale
C. temp locale
D. set locale
Solution: Every program has a single locale object which is its global locale.
Q: What will the monetary facet will do?
A. Handle formatting and parsing of monetary values
B. Handle formatting and parsing of character values
C. Parsing of character values
D. Deleting a character values
Solution: Monetary facet will handle formatting and parsing of monetary values.
Q: Which header file is used with input and output operations of C in C++?
A. stdio.h
B. cstdio
C. iostream
D. streamio
Solution: Input and Output operations of c can be performed in C++ using the C Standard Input and Output Library.
Q: Which will be used with physical devices to interact from C++ program?
A. Programs
B. Library
C. Streams
D. Iterators
Solution: C++ library uses streams to operate with physical devices such as Keyboards, Printers, Terminals or with any other type of files supported by the system.
Q: How many streams are automatically created when executing a program?
A. 1
B. 2
C. 3
D. 4
Solution: There are streams that are automatically created when executing a program. They are stdin, stdout and stderr.
Q: How many indicators are available in c++?
A. 4
B. 3
C. 2
D. 1
Solution: There are three indicators are available in C++. They are Error indicator, End-Of-File indicator and Position indicator.
Q: What is the benefit of c++ input and output over c input and output?
A. Type safety
B. Exception
C. Both Type safety & Exception
D. Sequence container
Solution: C++ input and output are type safety that means we don’t need to specify the type of variable we are printing.
eg:
in C we need to specify %d showing that an integer will be printed, whereas in C++ we just cout the variable.
printf(“%d”, a);
cout<

You Have Score    /10