Problem Solving Through Programming in C | Week 1

Session: JULY-DEC 2024

Course Name: Problem Solving Through Programming in C

Course Link: Click Here

For answers or latest updates join our telegram channel: Click here to join

These are Problem Solving Through Programming In C Week 1 Nptel Answers


Q1. Which of the following is a valid C variable name?
a) 2variable
b) variable_2
c) variable-2
d) variable.2

Answer: b) variable_2


Q2.Which of the following functions is used to read a single character from the keyboard in C?
a) printf()
b) scanf()
c) getchar()
d) puts()

Answer:c) getchar()


For answers or latest updates join our telegram channel: Click here to join

These are Problem Solving Through Programming In C Week 1 Nptel Answers


Q3.What is the purpose of the #include directive in a C program?
a) To include a library file.
b) To include a library file.
c) To define a constant.
d) To start the main function

Answer: b) To include a library file.


Q4.Which of the following correctly describes the purpose of a compiler in C?
a) To execute the program line by line.
b) To convert source code into machine code.
c) To provide a runtime environment for program execution.
d) To interpret and run the program interactively.

Answer:b) To convert source code into machine code.


For answers or latest updates join our telegram channel: Click here to join

These are Problem Solving Through Programming In C Week 1 Nptel Answers


Q5.Which of the following is true about the execution nature of C programs?
a) C programs are executed in an event-based manner.
b) C programs are executed concurrently.
c) C programs are executed in a multi-threaded manner.
d) C programs are executed sequentially.

See also  Problem Solving Through Programming In C Week 11

Answer:d) C programs are executed sequentially.


Q6.In C programming, what is the best way to comment multiple lines?
a) Using // at the beginning of each line.
b) Enclosing the comments between /* and */.
c) Using # at the beginning of each line.
d) Enclosing the comments between { and }.

Answer: b) Enclosing the comments between /* and */.


For answers or latest updates join our telegram channel: Click here to join

These are Problem Solving Through Programming In C Week 1 Nptel Answers


Q7.Which of the following is a characteristic of the ASCII standard?
a) It supports encoding for all the world’s languages.
b) It uses 16-bit encoding for characters.
c) It is a 7-bit character encoding standard.
d) None of the above.

Answer: c) It is a 7-bit character encoding standard.


Q8.Which of the following statements is true regarding variable declaration in C?
a) Variables can be declared at any point in the program.
b) Variables must be declared before they are used.
c) Variables are automatically initialized to zero.
d) Variable names can start with a digit.

Answer: b) Variables must be declared before they are used.


For answers or latest updates join our telegram channel: Click here to join

These are Problem Solving Through Programming In C Week 1 Nptel Answers


Q9. What will be the output of the flowchart given below?
a) 4
b) 8
c) 16
d) 20

Answer: c) 16


Q10. The output of the following algorithm is

a) 21
b) 28
c) 30
d) 40

Answer: b) 28


For answers or latest updates join our telegram channel: Click here to join

See also  Problem Solving Through Programming In C Nptel Week 5 Assignment Answers

These are Problem Solving Through Programming In C Week 1 Nptel Answers


All weeks of Problem Solving Through Programming in C : Click Here

More Nptel Courses: https://progiez.com/nptel-assignment-answers


These are Problem Solving Through Programming In C Week 1 Nptel Answers