1.

Explain different types of arrays.

Answer»

There are two types of array 

1. Single dimensional: It contains only one index or subscript. The index starts from 0 and ends with size-1. 

eg: int n[50]; 

char name[10]; 

2. Multi-dimensional: 

It contains more than one index or subscript. The two dimensional array contains two indices, one for rows and another for columns. The row index starts from 0 and end at row size-1 and column index starts at 0 and ends at colunn size-1. 

eg: int n[10][10] can store 10 × 10 = 100 elements. The index of the first element is n[0][0] and index of the 100th element is n[9][9],



Discussion

No Comment Found

Related InterviewSolutions