NPTEL Problem Solving Through Programming In C Week 7 Assignment Answers 2025
1. Which of the following statements are correct?
1) A string is a collection of characters terminated by ‘\0’.
2) The format specifier %s is used to print a string.
3) The length of the string can be obtained by using the function strlen().
4) The pointer cannot work on string
a) 1,2
b) 1,2,3
c) 2,4
d) 1,3
Answer :- For Answers Click Here
2. The correct method of initializing a 2D array is
- int abc[2][2] = {1, 2, 3 ,4}
- int abc[ ][ ] = {1, 2, 3 ,4}
- int abc[2][ ] = {1, 2, 3 ,4}
- All of the above
Answer :-
3. Array passed as an argument to a function is interpreted as
a) Address of all the elements in an array
b) Value of the first element of the array
c) Address of the first element of the array
d) Number of element of the array
Answer :-
4.
Answer :-
5.
a) fellows
b) h
c) fello
d) Compiler error
Answer :-
6.
a) n1=18, n2=17
b) n1=18, n2=18
c) n1=17, n1=17
d) n1=17, n2=18
Answer :- For Answers Click Here
7.
a) gnirts
b) gnirt
c) string
d) Nothing is printed
Answer :-
8. If the starting address of a floating point array Arr[10][10] is 2000,
what would be the memory address of the element Arr[5][6]? (Considering float takes 4 bytes of memory)
a) 2268
b) 2120
c) 2224
d) 2144
Answer :-
9. In C, the placement of elements of a two dimensional array is
a) Row wise
b) Column wise
c) Diagonal wise
d) Bottom to top wise
Answer :-
10.
Answer :- For Answers Click Here