NPTEL Programming, Data Structures And Algorithms Using Python Week 1 Quiz Assignment | NPTEL Swayam Assignment Answers
MCQs (multiple choice questions) Nptel Week 1 Quiz Answers:
Q.1: What does h(27993) return for the following function definition? Code is:
Answer is 10
Q.2: What is g(60) - g(48), given the definition of g below? Code is:
Answer is 2
Q.3: Consider the following function f. Code is:
(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:
(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 nonnegative n with foo(n) = factorial of n
(d) The function terminates for nonnegative n with foo(n) = n(n+1)/2
Answer is (d) The function terminates for nonnegative 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.
0 Comments