QUIZ ON : C LANGUAGE - ARRAYS

ARRAYS

00:00:00

In ‘C’, the compiler does not check if the subscript used for an array exceeds size of the array.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

In ‘C’, the compiler does not check if the subscript used for an array exceeds size of the array.

Question No# : 01 out of 20

The value of S[5] in the segment char s[15] = “ MICROPROCESSOR” is

Option A. P
Option B. O
Option C. R
Option D. None of the above
True Answer A

Explanation :

The value of S[5] in the segment char s[15] = “ MICROPROCESSOR” is

Question No# : 02 out of 20

Find output of the following program?

Option A. Greater
Option B. Smaller
Option C. Compile Error
Option D. 100
True Answer A

Explanation :

Find output of the following program?

Question No# : 03 out of 20

What is the effect of the following code?

main() { int a[4] = {25, 16};
printf(“%d %d”, a[0] & a[1], a[1]|a[2]) ; }

Option A. 16 16
Option B. Syntax error because of invalid operator symbol
Option C. 25 16
Option D. Syntax error because of invalid array initialization
True Answer A

Explanation :

What is the effect of the following code?

main() { int a[4] = {25, 16};
printf(“%d %d”, a[0] & a[1], a[1]|a[2]) ; }

Question No# : 04 out of 20



If array is initialized where it is declared, then mentioning __________ of array is optional.

Option A. Data type
Option B. Dimension
Option C. name
Option D. Data type and Dimension
True Answer B

Explanation :

If array is initialized where it is declared, then mentioning __________ of array is optional.

Question No# : 05 out of 20



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

Option A. -1
Option B. 1
Option C. 0
Option D. Yes
True Answer C

Explanation :
strcmp(const char *s1, const char*s2); The strcmp return an int value that is if s1 < s2 returns a value < 0 if s1 == s2 returns 0 if s1 > s2 returns a value > 0

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

Question No# : 06 out of 20



Two dimensional array is stored in memory physically as one-dimensional array.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

Two dimensional array is stored in memory physically as one-dimensional array.

Question No# : 07 out of 20

At the time of initialization of an array, dimension of the array need not to be specified.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :

At the time of initialization of an array, dimension of the array need not to be specified.

Question No# : 08 out of 20

A group of related data that share a common name is

Option A. Pointer
Option B. Array
Option C. Function
Option D. None of the above
True Answer B

Explanation :

A group of related data that share a common name is

Question No# : 09 out of 20

________ is a derived data type.

Option A. Array
Option B. INT
Option C. FLOAT
Option D. CHAR
True Answer A

Explanation :

________ is a derived data type.

Question No# : 10 out of 20

If the two strings are found to be unequal then strcmp returns difference between the first non-matching pair of characters.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

If the two strings are found to be unequal then strcmp returns difference between the first non-matching pair of characters.

Question No# : 11 out of 20

Disadvantage of array in C is

Option A. We can easily access each element
Option B. It is necessary to declare too many variables
Option C. It can store only one similar type of data
Option D. It is difficult to perform sorting operation on it
True Answer C

Explanation :

Disadvantage of array in C is

Question No# : 12 out of 20

The best average SORTING behavior is shown by merge sort.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

The best average SORTING behavior is shown by merge sort.

Question No# : 13 out of 20

The average number of comparison is sequential search is

Option A. n**2
Option B. n(n-1)/2
Option C. n(n+1)/2
Option D. n+1)/2
True Answer D

Explanation :

The average number of comparison is sequential search is

Question No# : 14 out of 20

The function strlen() computes the length of an argument string excluding the null character.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

The function strlen() computes the length of an argument string excluding the null character.

Question No# : 15 out of 20

Bounds of the array index are checked during execution.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

Bounds of the array index are checked during execution.

Question No# : 16 out of 20

Set of values of the same type, which have a single name followed by an index is called

Option A. function
Option B. structure
Option C. array
Option D. union
True Answer C

Explanation :

Set of values of the same type, which have a single name followed by an index is called

Question No# : 17 out of 20

The string &quot;Bilbo Baggins&quot;, may be stored in an array of 13 characters.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

The string &quot;Bilbo Baggins&quot;, may be stored in an array of 13 characters.

Question No# : 18 out of 20

Consider the statement given below:

int a[5] = {1, 2, 3, 4, 5}, *p = a;
Which printf statement will print the value of fourth element of the array?

Option A. printf(&quot;%d &quot;, *(p + 3));
Option B. printf(&quot;%d&quot;, p[4]);
Option C. printf(&quot;%d &quot;, a + 3);
Option D. printf(&quot;%d &quot;, *a + 3);
True Answer A

Explanation :

Consider the statement given below:

int a[5] = {1, 2, 3, 4, 5}, *p = a;
Which printf statement will print the value of fourth element of the array?

Question No# : 19 out of 20



There is no difference between &#39;&#39; and &#39;0&#39;.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :

There is no difference between &#39;&#39; and &#39;0&#39;.

Question No# : 20 out of 20


CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Website development Company in Allahabad