Quiz ->Assignment 3:
1.Consider the program below.
What will be the output?
Ans: d) s s2 s4
2.Consider the program below.
What will be the output?
Ans: c) 5 6
3.Consider the program below.
Which line/lines will give error.
Ans: a) Line-1
b) Line-2
4.Consider the program below.
What will be the output?
Ans: d) 1222
5.Consider the program below.
Fill in the blank at Line-1 such that the output is as follows:
Roy Mohan Ram
Ans: d) *lname , *mname , *fname
6.Consider the program below.
What is the type of this pointer associated with the object t?
Ans:a) const Test* this;
b) Test* const this;
7.Consider the program below.
What will be the output/error?
Ans: d) compilation error: constructor is private
8.Consider the program below.
What will be the output/error?
Ans: c) compiler error: assignment of data-member Data::_d is read-only object.
9.Consider the program below.
What will be the output/error?
Ans: c) Compiler Error: lvalue required as left operand of assignment
Disclaimer: Here you can find all nptel assignment solutions related to CS stream.These may help you for your assignment.The answers are only for verification.You cannot copy these directly from the post(code of conduct of NPTEL).These is not 100% correct solutions.
No comments:
Post a Comment
If you have any problems related to solutions or any concept please let me know.