Programming in Modern C++ Week 1 NPTEL Assignment Answers 2025

Programming in Modern C++ Week 1 NPTEL Assignment Answers 2025

1. Consider the following code segment.

#include<iostrean>
#include<string›
using namespace std;

int main(){
string greet = “Welcome Back”;
_____________; // LINE-1
cout << greet;
return 0;
}

Choose the correct option to fill in the blank at LINE-1 so that the output is Welcome.

a) greet resize(7)
b) greet. shrink to_fit()
c) greet.copy (“Welcome”, 7, 0)
d) strncpy (greet, “Welcome”, 7)

Answer : For Answers Click Here 

2.

Answer :

3.

Answer :

4.

Answer :

[tutor_course id=”31482, 26127, 15462, 1371, 2841, 11002″ exclude_ids=”” category=”” orderby=”ID” order=”DESC” count=”6″]

5.

Answer : For Answers Click Here

6.

Answer :

7.

Answer :

8.

Answer :

9.

Answer : For Answers Click Here

NPTEL Programming in Modern C++ Week 1 Assignment Answers 2024

1.

Answer :- D

2. Which of the following is NOT a container adapter?

a) stack
b) queue
c) deque
d) priority-queue

Answer :- c

3.

Answer :- a, c

[tutor_course id=”31482, 26127, 15462, 1371, 2841, 11002″ exclude_ids=”” category=”” orderby=”ID” order=”DESC” count=”6″]

4.

Answer :- b

5.

Answer :- a

6.

Answer :- a,c

7.

Answer :- d

8.

Answer :- a, c

9.

Answer :- b

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top