NPTEL Problem Solving Through Programming In C Week 6 Assignment Answers 2025
1. Which of the statements is correct?
a) An array contains more than one element
b) All elements of array have to be of same data type
c) The size of array has to be declared upfront
d) All of the above
Answer :- For Answers Click Here
2. An integer array of size 15 is declared in a C program. The memory location of the first byte of the array is 2000. What will be the location of the 13th element of the array? Assume int data type takes 2 bytes of memory.
a) 2013
b) 2024
c) 2026
d) 2030
Answer :-
3. Which statement is correct?
a) An index or subscript in array is a positive integer
b) An index or subscript in array is a positive or negative integer
c) An index or subscript in array is a real number
d) None
Answer :-
4. What will happen if in a C program you assign a value to an array element whose index exceeds the size of array?
a) The element will be set to 0
b) The compiler will not give any error but program may crash if some important data gets overwritten.
c) The compiler would report an error.
d) The array size would appropriately grow.
Answer :-
5. Which of the following statements is correct for the following code snippet?
int num[7];
num[7]=8;
a) In the first statement 7 specifies a particular element, whereas in the second statement it specifies a type;
b) In the first statement 7 specifies a particular element, whereas in the second statement it specifies the array size.
c) In the first statement 7 specifies the array size, whereas in the second statement it specifies a particular element of array.
d) In both the statement 7 specifies array size.
Answer :-
6.
a) 3 followed by garbage values
b) 3 0 0
c) 3 1 1
d) Syntax error
Answer :- For Answers Click Here
7.
a) i=5, j=5, k=2
b) i=6, j=5, k=3
c) i=6, j=4, k=2
d) i=5, j=4, k=2
Answer :-
8.
a) 1
b) 2
c) 3
d) 4
Answer :-
9.
Answer :-
10.
- a) 5,4
- b) 5,5
- c) 4,4
- d) 3,4
Answer :- For Answers Click Here