## NPTEL Problem Solving Through Programming in C Week 8 Assignment Answers 2024

1. What is the default return type if it is not specified in the function definition?

a) void

b) int

c) double

d) float

Answer :-For Answers Click Here

2.

a) 70

b) Garbage value

c) Compilation error

d) None

Answer :-For Answers Click Here

3.

a) Infinite times

b) 32767

c) 65535

d) Till stack overflows

Answer :-For Answers Click Here

4. Which of the following statements is correct?

a) A function with same name cannot have different signatures

b) A function with same name cannot have different return types

c) A function with same name cannot have different number of parameters

d) All of the mentioned

Answer :-

5

a) x * y where x and y are integers

b) x * y where x and y are non-negative integers

c) x + y where x and y are integers

d) x + y where x and y are non-negative integers

Answer :-

6.

a) 8, 4, 0, 2, 14

b) 8, 4, 0, 2, 0

c) 2, 0, 4, 8, 14

d) 2, 0, 4, 8, 0

Answer :-For Answers Click Here

7.

a) 25

b) 5

c) 15

d) 10

Answer :- c

8.

a) Before swapping num1 = 10 num2 = 20

After swapping num1 = 10 num2 = 20

b) Before swapping num1 = 10 num2 = 20

After swapping num1 = 20 num2 = 10

c) Before swapping num1 = 10 num2 = 20

After swapping num1 = 20 num2 = 20

d) Before swapping num1 = 10 num2 = 20

After swapping num1 = 10 num2 = 10

Answer :-

9.

a) Maximum of a, b

b) Positive difference between a and b

c) Sum of a and b

d) Minimum of a and b

Answer :-

10.

(a) For some values of n, the environment will almost certainly exhaust its stack space before the calculation completes.

(b) An error in the algorithm causes unbounded recursion for all values of n.

(c) A break statement should be inserted after each case. Fall-through is not desirable here.

(d) The fibonacci() function includes calls to itself. This is not directly supported by Standard C due to its unreliability.

Answer :-For Answers Click Here