NPTEL Programming Data Structures And Algorithms Using Python | NPTEL Week 1 Quiz Assignment | NPTEL Assignment Solutions

NPTEL Programming, Data Structures And Algorithms Using Python Week 1 Quiz Assignment | NPTEL Swayam Assignment Answers 


nptel programming data structures and algorithms using python



MCQs (multiple choice questions) Nptel Week 1 Quiz Answers:

Q.1: What does h(27993) return for the following function definition? Code is:

what does h(27993) return for the following function definition?



Answer is 10


Q.2: What is g(60) - g(48), given the definition of g below? Code is:

what is g(60) - g(48), given the definition of g below?

Answer is 2


Q.3: Consider the following function f. Code is:

consider the following function f


Options are:

(a) n is an odd number.
(b) n is a prime number.
(c) n is a perfect square.
(d) n is a composite number.

Answer is (c) n is perfect square.


Q.4: Consider the following function foo. Code is:

consider the following function foo

Options are:

(a) The function always terminates with foo(n) = factorial of n
(b) The function always terminates with foo(n) = n(n+1)/2
(c) The function terminates for non­negative n with foo(n) = factorial of n
(d) The function terminates for non­negative n with foo(n) = n(n+1)/2

Answer is (d) The function terminates for non­negative n with foo(n) = n(n+1)/2


If you are facing any queries regarding this assignment solutions, then please drop comment in comment section.







Post a Comment

0 Comments