Sign Up

Sign In

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask a question.

NPTEL An Introduction To Programming Through C++ Assignment 8 Answers 2022

Are you looking for some help in nptel an introduction to programming through C++ assignment 8 answers? So, in this article, we will provide you hints of the below-given questions.

NPTEL An Introduction To Programming Through C++ Assignment 8 Answers (Week 8)

Q1. What will get printed due to the line labeled A above?

a. The letter ‘a’
b. The letter ‘b’
c. The letter ‘c’
d. It is not possible to predict what will be printed.

Answer: c. The letter ‘c’

Follow Sikshapath’s Telegram Channel for instant notifications of answers updates.


Q2. What will get printed due to the line labeled B above?

a. The letter ‘a’
b. The letter ‘b’
c. The letter ‘c’
d. It is not possible to predict what will be printed.

Answer: d. It is not possible to predict what will be printed.


Q3. In the same code, suppose the user typed “abcdefghijkl”. Which of the following are true?

a. C++ will change the array size so that what the user types will be accommodated.
b. What the user types will potentially be stored in regions of memory not allocated for the variable buffer.
c. There is a different way in C++ to read data into char arrays so that no other variables get affected.

Answer: b. What the user types will potentially be stored in regions of memory not allocated for the variable buffer.
c. There is a different way in C++ to read data into char arrays so that no other variables get affected.


Q4. What will the value of argc be?

Answer: 4


Q5. What will the value of argv[2][2] be? Write without placing quotes etc.

Answer: u


Q6. Suppose the binary search function BSearch is called using an array of size 128. How many calls will there be including the initial?

Answer: 8


Q7. What will be the size of the array U declared in it?

Answer: 2


Q8. After mergesort has been called on U, V, what will V[0] equal?

Answer: 1


Q9. Select the correct statements among those given below. Assume that the sequence considered for sorting contains distinct elements.

a. During the execution of mergesort, the smallest element will always be compared with the second smallest.

b. During the execution of mergesort, the smallest element will always be compared with the third smallest.

c. During the execution of selectionsort, the smallest element will always be compared with the second smallest.

d. During the execution of selectionsort, the smallest element will always be compared with the third smallest.

Answer: a. During the execution of mergesort, the smallest element will always be compared with the second smallest.

Q10. Consider the merge function called to merge two sorted sequences of lengths m, n respectively. Suppose m < n. What is the minimum number of comparisons (between the elements of the sorted sequence)that the merge function must perform, no matter what the values of the elements?

a. m

b. n

c. m+n

d. None of the above

Answer: a. m

Q11. What is L?

Answer: 16


Q12. What will the first line print?

a. Nothing

b. 1

c. 4

d. 7

e. 9

f. 1 4 7 9

Answer: a. Nothing


Q13. What will the last line print?

a. Nothing

b. 1

c. 4

d. 7

e. 9

f. 1 4 7 9

Answer: f. 1 4 7 9


Disclaimer: These answers are provided only for the purpose to help students to take references. This website does not claim any surety of 100% correct answers. So, this website urges you to complete your assignment yourself.


Also Available:

Problem Solving through Programming in C NPTEL Week 8 Assignment Answers

Related Posts