Top

Arrays

101.

Assuming int is of 4bytes, what is the size of int arr[15];?

Answer: D

Since there are 15 int elements and each int is of 4bytes, we get 15*4 = 60bytes.

Enter details here

102.

A program P reads in 500 integers in the range [0..100] exepresenting the scores of 500 students. It then prints the frequency of each score above 50. What would be the best way for P to store the frequencies? 

Answer: A

No answer description available for this question.

Enter details here

Answer: C

No answer description available for this question.
 

Enter details here

104.

If n has the value 3, then the statement
 

a [++n] = n++ ;

 

Answer: D

No answer description available for this question.

Enter details here

105.

Comment on the below statements with respect to A and B

int *a1[8];

int *(a2[8]);

A. Array of pointers

B. Pointer to an array

Answer: C

No answer description available for this question.

Enter details here

106.

The parameter passing mechanism for an array is

Answer: B

The parameter passing mechanism for an array is call by reference.This technique uses in/out-mode semantics. Changes made to formal parameter do get transmitted back to the caller through parameter passing. Any changes to the formal parameter are reflected in the actual parameter in the calling environment as formal parameter receives a reference (or pointer) to the actual data.

Enter details here

107.

What will be the output of the program if the array begins at address 65486?

#include

int main()
{
    int arr[] = {12, 14, 15, 23, 45};
    printf("%u, %u\n", arr, &arr);
    return 0;
}

 

Answer: B

No answer description available for this question.

Enter details here

108.

Consider the array definition

int num [10] =  {3, 3, 3};

Pick the Correct answers

Answer: A

No answer description available for this question.

Enter details here

109.

What will be the output of the program ?

#include

int main()
{
    int a[5] = {5, 1, 15, 20, 25};
    int i, j, m;
    i = ++a[1];
    j = a[1]++;
    m = a[i++];
    printf("%d, %d, %d", i, j, m);
    return 0;
}

 

Answer: C

No answer description available for this question.

Enter details here

Answer: D

No answer description available for this question.

Enter details here

Loading…
Tags: Arrays Questions and Answers || Arrays MCQ Questions and Answers || Arrays GK Questions and Answers || Arrays GK MCQ Questions || Arrays Multiple Choice Questions and Answers || Arrays GK || GK on Arrays || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming