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

Join Our WhatsApp Group Join Now
Join Us On Telegram Join Now

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

1. What is the correct way to declare a constant in C?

a) int const a;
b) constant int a;
c) #define a
d) Both (a) and (c)

Answer :-  For Answer Click Here

2. What will be the output of the following code snippet?
printf(“%d”, 5 == 5);

a) 5
b) 0″
c) 1
d) True

Answer :-  For Answer Click Here

3. A syntax error occurs when

a) The rules of grammar of the language is violated
b) The statements in the program have no meaning
c) The program gives wrong or undesired output
d) Some illegal operation (e.g. divide by zero) is done

Answer :-  For Answer Click Here

4. If an integer needs two bytes of storage, then the minimum value of a signed integer in C would be

NPTEL Problem Solving Through Programming In C Week 2 Assignment Answers 2024
NPTEL Problem Solving Through Programming In C Week 2 Assignment Answers 2024
NPTEL Problem Solving Through Programming In C Week 2 Assignment Answers 2024
NPTEL Problem Solving Through Programming In C Week 2 Assignment Answers 2024
Answer :- 

5. What will happen if you try to store a value beyond the range of the declared data type of a variable in C?

a)    Compile-time error
b) Run-time error
c)     Data loss or wrap around
d)     No error

Answer :- 

6. Which of the following is not a primitive data type in C?

a)    int
b) float
c) char
d) string

Answer :-  For Answer Click Here

7. What is the size of an ‘int’ data type in C?

a)     2 bytes
b)     Depends on the compiler
c)     4 bytes
d)     1 byte

Answer :- 

8. Which keyword is used to create a constant variable in C?

a) const
b) define
c) static
d) fixed

Answer :- 

9. What is the default return type of a function in C if it is not explicitly specified?

a)     int
b)     float
c)     void
d)     char

Answer :- 

10.

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

a)     ==, !=
b)     !=, ==
c)     ==, ==
d)     <, >

Answer :- For Answer Click Here