NEW
Font size
WorksheetsC++ : Assignment 6
Total questions: 10
Worksheet time: 5mins
Object _______ and operator _______ are used for reading
cin >>
cout <<
cin <<
none of the above
Manipulators without parameters such as endl, hex, dec etc are defined in __________ file.
iomanip.h
conio.h
io.h
fstream.h
none of the above
Of the following, _________ is not a manipulator.
dec
scientific
endl
flush
hex
Which of the following manipulator is used for the representing octal equivalent of a given decimal number ?
oct
setbase(8)
tobase(8)
both a and b
all a, b, c
Predict the output:
int x = 786;
cout <<setfill(‘*’)<<setw(6)<<x;
786***
**786
***786
******
Predict the output:
float x= 3.1496;
cout<<setprecision(2)<<x;
3.1
3.15
3.149
None of these
if you have to make decision based on multiple choices, which of the following is best suited?
if
if-else
if-else-if
All of the above
In situations where we need to execute body of the loop before testing the condition, we should use_____.
for loop
while loop
do-while loop
nested for loop
Which of the following can replace a simple if -else construct?
Ternary operator
while loop
do-while loop
for loop
The switch statement is also called as?
choosing structure
selective structure
certain structure
bitwise structure
