Array

Array is a “data structure” for storing the sequential elements of the same type. Suppose we want to store five integer elements then we have to take five different variables to store the values, however its very difficult to remember all the variables name. To remove this problem we have use the array data structure through which we can access all the five variables value without remembering the variable name.
Example-> a,b,c,d,e are the five variables to store the amount of five people instead we can use amount[6] to store amount of five people. The values are access through the index.



The name of the array is amount and 0, 1, 2 etc. are index.

Declaration:-

DataType array_name[No. of index];

EXAMPLE

int amount[5];

Program




COMPILATION

Enter the amount of five people
1000
2000
3000
4000
5000

OUTPUT
The amount of five people are :-
1000
2000
3000
4000
5000
Author:- Deepti Gupta
Email:- deepti.gupta24@yahoo.com