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.
a) x=1
b) x=0
c) Depends on compiler
d) No print statements
Answer :- For Answer Click Here
3.
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.
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.
a) 5
b) 6
c) 10
d) 11
Answer :- For Answer Click Here
8.
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.
a) Choice is 1
b) Choice other than 1
c) Both (a) and (b)
d) Syntax error
Answer :- For Answer Click Here