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

admin
By admin

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

1. The control/conditional statements used in C is/are

a) if-else statements
b) switch statements
c) Both (a) and (b)
d) None of the above

Answer :- For Answer Click Here

2.

W04Q02

a) x=1
b) x=0
c) Depends on compiler
d) No print statements

Answer :- For Answer Click Here

3.

W04Q03

a) 2
b) 3
c) 4
d) Compiler error

Answer :- 

4. If multiple conditions are used in a single if statement then the testing of those conditions are done

a) From Right to Left
b) From Left to Right
c) Randomly
d) None

Answer :- For Answer Click Here

5.

W04Q05

a) Sum of the digits of a number
b) The negative sum of the digits of a number
c) The reverse of a number
d) The same number is printed

Answer :- 

6. while(1) is used in a program to create

a) False statement
b) Infinite loop
c) Terminating the loop
d) Never executed loop

Answer :- 

7.

W04Q07

a) 5
b) 6
c) 10
d) 11

Answer :- For Answer Click Here

8.

W04Q08

a) NPTEL
b) PROGRAMMING
c) No output
d) Compilation error as A and a are not declared as character variable

Answer :- 

9. Switch statement accepts

a) int
b) char
c) long
d) All of the above

Answer :- 

10.

W04Q10

a) Choice is 1
b) Choice other than 1
c) Both (a) and (b)
d) Syntax error

Answer :- For Answer Click Here
Share This Article
Leave a comment