# Tag Archives: C-Arrays

## Program to print Sum of even and odd elements in an array

Prerequisite – Array Basics Given an array, write a program to find the sum of values of even and odd index positions separately. Examples: Input… Read More »

## How to pass an array by value in C ?

In C, array name represents address and when we pass an array, we actually pass address and the parameter receiving function always accepts them as… Read More »

## How to concatenate two integer arrays without using loop in C ?

Given two arrays such that first array has enough extra space to accommodate elements of second array. How to concatenate second array to first in… Read More »

## C | Arrays | Question 14

(A) 5 (B) 6 (C) 9 (D) None of the above Answer: (C) Explanation: Quiz of this Question

## C | Arrays | Question 13

Which of the following will print the value 2 for the above code? (A) printf(“%d”,*(((a+5)+2)+1)); (B) printf(“%d”,***((a+5)+2)+1); (C) printf(“%d”,*(*(*(a+5)+2)+1)); (D) None of these Answer: (C)… Read More »

## C | Arrays | Question 12

(A) 1 2 3 4 (B) Compiler Error in line ” int a[][] = {{1,2},{3,4}};” (C) 4 garbage values (D) 4 3 2 1 Answer:… Read More »

## C | Arrays | Question 11

Does C perform array out of bound checking? What is the output of the following program? (A) Compiler Error: Array index out of bound. (B)… Read More »

## C | Arrays | Question 10

Predict output of following program (A) 1 followed by four garbage values (B) 1 0 0 0 0 (C) 1 1 1 1 1 (D)… Read More »

## C | Arrays | Question 9

Predict the output of the below program: (A) 20 30 40 (B) 20 20 40 (C) 50 20 40 (D) Compile-time error Answer: (C) Explanation:… Read More »

## C | Arrays | Question 14

Which of the following is true about arrays in C. (A) For every type T, there can be an array of T. (B) For every… Read More »

## C | Arrays | Question 7

Consider the following declaration of a ‘two-dimensional array in C: Assuming that the main memory is byte-addressable and that the array is stored starting from… Read More »

## C | Arrays | Question 6

Assume the following C variable declaration Of the following expressions I A[2] II A[2][3] III B[1] IV B[2][3] which will not give compile-time errors if… Read More »

## C | Arrays | Question 5

Consider the following C-function in which a[n] and b[m] are two sorted integer arrays and c[n + m] be another integer array. Which of the… Read More »

## C | Arrays | Question 4

Output of following program? (A) 1 (B) 2 (C) 6 (D) Runtime Error Answer: (C) Explanation: &a is address of the whole array a[]. If… Read More »

## C | Arrays | Question 3

What is output? (A) 1, 2, 3, 4, 5, 6, 7, 8 (B) Compiler Error (C) 1 (D) Run Time Error Answer: (C) Explanation: See… Read More »