Programming in Modern C++ Week 10 Assignment Answers

Are you looking for the NPTEL Programming in Modern C++ Week 10 Assignment Answers? You’ve come to the right place! This resource provides comprehensive solutions to all the questions from the Week 10 assignment, helping you navigate through the complexities of modern C++ programming.



Programming in Modern C++ Week 10 Assignment Answers (Jan-Apr 2025)

Course Link: Click Here


1) Identify the appropriate option/s to fill in the blank at LINE-I such that output becomes B B

a) auto
b) auto&
c) decltype(rn)
d) decltype(n)

View Answer


2) Identify the appropriate option/s to fill in the blank at LINE-I such that output becomes i 2.

a) auto foobar(Ut op) -> decltype(op())
b) auto foobar(U& op)
c) auto& foobar(U& op)
d) decltype(auto) foobar(Ut op)

View Answer


3) Identify the appropriate option that presents all correct output/errors for the following instantiations of CustList class:

  1. CustList c{3.1, 4.5, 6.5};
  2. CustList c(3.1, 4.5, 6.5);
  3. CustList c{3, 4.5f, 6.5};
  4. CustList c{3, 4.5, 6};

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

View Answer


4) Which of the following line/s generate/s a compiler error?

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

View Answer


5) Which of the following lines generate/s a compiler error?

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

View Answer


6) Identify the appropriate option to fill in the blanks at LINE-I and LINE-2 such that the output becomes size (in bytes) : 1024.

a)
b)
c)
d)

View Answer


7) Identify the correct option about the program above.

a) It generates output as 2 3 0 3
b) It generates output as 2 3 -1 2
c) It generates output as 2 3 -1 3
d) The program gets terminated since a function that is declared noexcept throws an exception

View Answer


8) Identify the line/s that generate/s a compiler error.

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

View Answer


9) What will be the output?

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

View Answer


Programming in Modern C++ Week 10 Assignment Answers

For answers to others Nptel courses, please refer to this link: NPTEL Assignment