NPTEL Problem Solving Through Programming in C Week 2 Assignment Answers 2024

admin
By admin

NPTEL Problem Solving Through Programming in C Week 2 Assignment Answers 2024

1. Which of the following correctly defines a function in C?

  • a) Block of statements to perform some specific task
  • b) It is a fundamental modular unit to perform some task
  • c) It has a name and can be used multiple times
  • d) All of the above are true
Answer :- Click Here

2. If an integer requires two bytes of storage, what is the maximum value of an unsigned integer in C?

a. 215-1
b. 216-1
c. 215
d. 216

Answer :- Click Here

3. Which of the following statements is correct?

I. Keywords are those words whose meaning is already defined by Compiler.
II. Keywords cannot be used as variable names.
III. There are 32 keywords in C
IV. C keywords are also called reserved words.

a) I and II
b) II and III
c) I, II and IV
d) All of the above are correct

Answer :- 

4.

W02Q04

a) 10 5
b) 5 10
c) 0 15
d) Compilation error

Answer :- Click Here

5.

W02Q05
Answer :- 

6.

W02Q06

a) 25
b) 13
c) 11
d) Compilation error

Answer :- Click Here

7. Which of the following header files is not a standard C library?

a) stdlib.h
b) math.h
c) iostream.h
d) stdio.h

Answer :- 

8. What is the primary use of the ‘printf’ function in C?

a) To read input from the user
b) To perform mathematical calculations
c) To display output on the screen
d) To allocate memory dynamically

Answer :- 

9. What is the purpose of the ‘return’ statement in C?

a) To terminate a loop
b) To end a program
c) To exit a function and return a value
d) To declare a variable

Answer :- 

10. What is typecasting in C?

a) Assigning a value to a variable
b) Converting a variable from one data type to another
c) Defining a new data type
d) Initializing a variable with a constant value

Answer :- Click Here
Share This Article
Leave a comment