Question: In C programming 1. Write a declaration statement that will declare a char array with 6 elements and initialize the elements to $, A, !,

In C programming

1. Write a declaration statement that will declare a char array with 6 elements and initialize the elements to $, A, !, *, @, (.

2. Assume an array is declared as follows. float dataArray[] = {0.5f, 3.4f, 2.4f, 7.5f, 7.8f}; Write a for loop that will print out all of the elements in the array dataArray.

3. Declare an integer array odds with 20 elements. Use a for loop initialize the elements in the array to odd numbers. 5, 7, 11, etc. Hint: assign values as 2 * index + 5.

4. (a) Create a floating point array named hours with 10 elements. (b) Write a while loop that will prompt the users for the hours worked for the 10 employees. (c) Write another while loop that will print out the hours worked and sum up all the hours and store into total. (d) Write out the total hours worked. (e) Write another while loop that will check the hours of each employee to see if they are greater than 40, if true, add one to a variable overtime. (f) Write the number of employees who worked overtime. Try 38.75, 24, 35, 57, 23, 78.3, 11, 36, 40, 42.5 as a sample data set.

IN C programming

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!