Arrays are declared as follows:
The quantity mentioned inside the parenthesis denotes the subscript and it takes non-negative values. p denotes that the range for the subscripts is 0..4 and that the array elements are p .... p. The first declaration int informs the compiler that the elements of the array named p can take only integer values and the second and third declarations inform the compiler that the elements of the array temp can take float values and the elements of the array a can take character values.
Following are some examples to illustrate the use of one-dimensional arrays.
The program inputs the salary of 10 employees and finds the enhanced salary of employees with 15% raise in their salaries.
cout<<"Enter 10 Numbers : ";
newemp_sal[i] = ( emp_sal[i] *1.15);
cout << newemp_sal[i]<<" " ;