Description
At the end of the class the students should be able to:
- Use arrays in C programs.
Exercise 1:
Write a C program to the following :
- Create a single-subscripted array of size 10;
- Initialize the array with 25, 32, 45, 2, 13, 9, 6, 10, 17, 4.
- Input a search key (number) from the key board and display the location within the array, if the search key is found. If not display “Value not found”.
Exercise 2:
Write a C program to multiply the content of array A and B and store it in a new array called C.
int A[5] = { 10, 20, 30, 40, 50};
int B[5] = { 34, 67, 12, 89, 12};
Exercise 3:
A company pays its employees a salary between $200 to $1500 .Write a C program (using arrays of counters) that determine how many of the employees earned salaries in each of the following ranges ( assume that each employee’s salary is truncated to an integer amount). The program should stop entering the salaries, when the user input -1 a salary.
- $200 – $299
- $300 – $399
- $400 – $499
- $500 – $599
- $600 – $699
- $700 – $799
- $800 – $899
- $900 – $999
- 1000 and above
1




