What manipulator is used to cause the field to be left-justified with padding sp
ID: 3806286 • Letter: W
Question
What manipulator is used to cause the field to be left-justified with padding spaces printed the right? ______ left left _ justify left_ pad. right None of these When the final value of an expression is assigned to a variable, it will be converted to __________. The smallest C++ data type The largest C++ data type The data type of the variable The data type of the expression None of the above What will be the output of the following code segment after the user enters 0 at the keyboard? ________ int x=-1; cout x; if(x!=0) coutExplanation / Answer
9. What manipulator is used the field to left justified with padding spaces printed to the right?
Ans: a) left
In left manipulator the output is padded to the field width appending fill characters at the end.
10. When the find value of an expression is assigned to a variable,it will be converted to
Ans: c) The data type of the variable
If an expression is assigned to a variable with different data type then the value of the expression is converted to the data type of the variable.
11.What will be the output of the following cod segment after the user enters 0 at the keyboard?
int x=-1;
cout<<"Enter a 0 or a1 from the keyboard: ";
cin>>x;
if(x!=0)
cout<<"true"<<endl;
else
cout<<"false"<<endl;
Ans: b) false
If we enter 0 for x then the if condition i.e. (x!=0) will not be satisfied so the statement written in else block will get executed.
12. Which of the following operators takes an operand and reverses its tru..
Ans: d) !
! operator takes an operand and reverses its result.For eg. if there is a boolean variable 'x' whose value is 'true' then !x will result in 'false'.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.