Programming in Modern C++ | NPTEL 2023 | Week 3 Assignment Solutions

This set of MCQ(multiple choice questions) will help you with the answers of Programming in Modern C++ NPTEL 2023 Week 3 Assignment Solutions.

Programming in C++ is so fundamental that all companies dealing with systems as well as application development (including web, IoT, embedded systems) have a need for the same. These include – Microsoft, Samsung, Xerox, Yahoo, Oracle, Google, IBM, TCS, Infosys, Amazon, Flipkart, etc. This course would help industry developers to be up-to-date with the advances in C++ so that they can remain at the state-of-the-art.

Course layout (Answers link)

Answers COMING SOON! Kindly Wait!

Week 0: Assignment answers
Week 1: Programming in C++ is Fun
Week 2: C++ as Better C.
Week 3: OOP in C++.
Week 4: OOP in C++. 
Week 5: Inheritance.
Week 6: Polymorphism. 
Week 7: Type Casting.
Week 8: Exceptions and Templates.
Week 9: Streams and STL
Week 10: Modern C++
Week 11: Lambda and Concurrency.
Week 12: Move, Rvalue and STL Containers.

NOTE: You can check your answer immediately by clicking show answer button. This set ofProgramming in Modern C++ NPTEL 2023 Week 3 Assignment Solution” contains 09 questions.

Now, start attempting the quiz.

Programming in Modern C++ NPTEL 2023 Week 3 Assignment Solutions

Q1. What will be the output/error?

a) Compilation error at LINE-1
b) s s2 s s4
c) s s2 s4
d) s2 s4

Answer: c)

Q2. What will be the output?

a) 3 4
b) 15 16
c) 9 10
d) 4 5

Answer: c)

Q3. Which line/s will generate compilation error/s?

a) LINE-1
b) LINE-2
c) LINE-3
d) LINE-4

Answer: a), b)

Q4. What will be the output?

a) 02020202
b) 0202
c) 0222
d) 0002

Answer: c)

Q5. What is the type of this pointer associated with the object c?

a) const Check* this
b) Check* const this
c) Check const* const this
d) const Check* const this

Answer: c), d)

Programming in Modern C++ NPTEL Week 3 Assignment Solutions

Q6. What will be the output/error?

a) 0
b) K
c) 0K
d) Compilation error: call of overload Test() is ambiguous

Answer: d)

Q7. What will be the output/error?

a) 10 20
b) 20 50
c) Compilation Error: lvalue required as left operand of assignment
d) Compilation Error: private data members are inaccessible

Answer: c)

Programming in Modern C++ NPTEL Week 3 Assignment Solutions

Q8. What will be the output/error?

a) 0
b) 5
c) 6
d) Compilation error: assignment of member ‘Data::_d’ in read-only object

Answer: d)

Programming in Modern C++ NPTEL Week 3 Assignment Solutions

Q9. Fill in the blank at LINE-1 so that the program will print 2.

a) ++x
b) ++this->x
c) x++
d) ++this.x

Answer: a), b)

Programming in Modern C++ NPTEL 2023 Week 3 Assignment Solutions

Q1. Which line/s will generate an error?

a) LINE-1
b) LINE-2
c) LINE-3
d) LINE-4

Answer: a)

Q2. Fill in the blanks with proper access specifiers so that member y can be accessed from outside of the class but member x cannot be accessed.

a) public, public
b) public, private
c) private, public
d) private, private

Answer: c) private, public

Q3. What will be the output/error?

a) 1st
b) 2nd
c) 1st
2nd
d) Compilation Error: call of overloaded ‘myClass()’ is ambiguous

Answer: d) Compilation Error: call of overloaded ‘myClass()’ is ambiguous

Q4. What will be the output?

a) 1 2
b) 3 1
c) 2 3
d) 3 4

Answer: c) 2 3

Q5. Fill in the blank at LINE-1 so that the program will print fun is coding.

a) *lstr, *mstr, *fstr
b) *mstr, *fstr, *lstr
c) *lstr, *fstr, *mstr
d) *fstr, *lstr, *mstr

Answer: a) *lstr, *mstr, *fstr

Programming in Modern C++ NPTEL Week 3 Assignment Answers

Q6. What will be the output?

a) 2 7
b) 0 0
c) Compilation error: no default constructor
d) Compilation error: constructor is private

Answer: d) Compilation error: constructor is private

Q7. What will be the output/error?

a) 10 20
b) 20 50
c) Compilation Error: lvalue required as left operand of assignment
d) Compilation Error: private data members are incaccessible

Answer: c) Compilation Error: lvalue required as left operand of assignment

Programming in Modern C++ NPTEL Week 3 Assignment Answers

Q8. What wil be the output/error?

a) 1st
b) 2nd
c) 1st
2nd
d) Compilation error: conversion from ‘int’ to ‘Test’ is ambiguous

Answer: d) Compilation error: conversion from ‘int’ to ‘Test’ is ambiguous

Q9. Fill in the blank at LINE-1 such that the program will print 5.

a) int
b) const int
c) mutable int
d) int mutable

Answer: c), d)

Programming in Modern C++ NPTEL 2022 Week 3 Assignment Solutions

Q1.

Answer: c), d)

Q2.

Answer: b)

Q3.

Answer: d)

Q4.

a) D E F
b) B C D
c) B C D E F
d) D E F G H I J K

Answer: a)

Q5.

Answer: c), d)

Programming in Modern C++ NPTEL Week 3 Assignment Solutions

Q6.

Answer: b)

Q7.

Answer: b)

Programming in Modern C++ NPTEL Week 3 Assignment Solutions

Q8.

Answer: d)

Programming in Modern C++ NPTEL Week 3 Assignment Solutions

Q9.

Answer: c)

<< Prev- Programming in Modern C++ Week 2 Assignment Solutions

>> Next- Programming in Modern C++ Week 4 Assignment Solutions


DISCLAIMER: Use these answers only for the reference purpose. Quizermania doesn't claim these answers to be 100% correct. So, make sure you submit your assignments on the basis of your knowledge.

NPTEL answers: Principles of Management

NPTEL answers: Problem solving through programming in C

Programming in Java NPTEL week 1 quiz answers

NPTEL – Python for Data Science assignment solutions

Nptel – Deep Learning assignment solutions

For discussion about any question, join the below comment section. And get the solution of your query. Also, try to share your thoughts about the topics covered in this particular quiz.