Question 1
5 1 4
5 6 9
5 16 10
5 11 10
The IIT Madras BS Programming in C (Programming in C) End Term paper sat on 13 Apr 2025, in the January 2025 term, set 1-4: 17 questions for 43 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.
5 1 4
5 6 9
5 16 10
5 11 10
Correct answer
5 11 10
int *ptr = &var;
int *ptr = *var
int *ptr = $var;
int ptr = *var;
Correct answer
int *ptr = &var;
In C programming, which memory region is primarily used for storing local variables of functions and function call information?
Heap memory
Stack memory
Static memory
Code segment
Correct answer
Stack memory
Declares a global variable that can be used in multiple files.
Creates a macro that replaces text before compilation.
Defines a function which may have parameters.
Includes the content of another file during compilation.
Correct answer
Includes the content of another file during compilation.
22
21
28
24
Correct answer
28
20 -10
-10 10
-10 20
-20 10
Correct answer
-10 10
Systems
ystems
stems
tems
Correct answer
ystems
[3, 5, 4, -7, 6, 2]
[6, 5, 4, 3, 2, 1]
[-4, -3, -2, 5, 1, -6]
[-5, -3, -2, -6, -1, -4]
Correct answer
[-5, -3, -2, -6, -1, -4]
14
11
8
16
Correct answer
11
Which of the following is not a storage class specifier?
register
static
volatile
typedef
Correct answer
volatile
Which of the following statements is/are true about the if statement in C?
else if is compulsory to use with if statement.
else is compulsory to use with if statement.
else or else if is optional with if statement.
Multiple else if are allowed with if statement.
Correct answers
else or else if is optional with if statement.
Multiple else if are allowed with if statement.
In C, which of the following is/are valid operation(s) on pointer variables?
Dividing one pointer variable by another pointer variable.
Comparing two pointers variables for equality.
Incrementing/Decrementing a pointer variable (e.g. ptr++/ ptr–).
Multiplying two pointer variables.
Correct answers
Comparing two pointers variables for equality.
Incrementing/Decrementing a pointer variable (e.g. ptr++/ ptr–).
Correct answer: 7
Correct answer: 14
Correct answer: 100
Correct answer: 13
Correct answer: 28