Arrays and Strings - C programming MCQs

@T-Bone

Here you will get C Programming with Array Multiple Choice Questions And Answers for you next job or exam.

Here you will get C Programming with Array Multiple Choice Questions And Answers for you next job or exam.

Questions

1. What is right way to initialize array?

Mark the correct option

2. What is the maximum number of dimensions an array in C may have?

Mark the correct option

3. A one dimensional array A has indices 1....75. Each element is a string and takes up three memory words. The array is stored at location 1120 decimal. The starting address of A[49] is

Mark the correct option

4. What will be the address of the arr[2][3] if arr is a 2-D long array of 4 rows and 5 columns and starting address of the array is 2000?

Mark the correct option

5. Array can be considered as set of elements stored in consecutive memory locations but having __________.

Mark the correct option

6. Array is an example of _______ type memory allocation.

Mark the correct option

7. Size of the array need not be specified, when

Mark the correct option

8. The information about an array used in program will be stored in

Mark the correct option

9. The parameter passing mechanism for an array is

Mark the correct option

10. A string that is a formal parameter can be declared

Mark the correct option

11. Which of the following function is more appropriate for reading in a multi-word string?

Mark the correct option

12. Length of the string "letsfindcourse" is

Mark the correct option

13. How will you print on the screen?

Mark the correct option

14. If the two strings are identical, then strcmp() function returns

Mark the correct option

15. Which of the following statements are correct ? 1: A string is a collection of characters terminated by '. 2: The format specifier %s is used to print a string. 3: The length of the string can be obtained by strlen(). 4: The pointer CANNOT work on string.

Mark the correct option

16. Let x be an array.Which of the following operations is illegal? i) ++x. ii) x+1. iii) x++. iv) x*2

Mark the correct option

17. Strcat function adds null character

Mark the correct option

18. Which of the following function sets first n characters of a string to a given character?

Mark the correct option

19. The library function used to find the last occurrence of a character in a string is

Mark the correct option

20. Which of the following gives the memory address of the first element in array foo, an array with 10 elements?

Mark the correct option

Index of Questions