Question: In C programming Write a program that will read five values from the keyboard (you must use a loop) and store them in an array

In C programming

In C programming Write a program that will read five values from

Write a program that will read five values from the keyboard (you must use a loop) and store them in an array of type float with the name "amounts". Create two arrays of five elements of type long with the names "dollars" and "cants". Store the whole number part of each value in the "amounts" array in the corresponding element of "dollars" and the fractional part of the amount as a two-digit integer in "cents" (e.g., 2.75 in "amounts" [1] would result in 2 being stored in "dollars" [1] and 75 being stored in "cents" [1]). Output the values from the two arrays of type long as monetary amounts (e.g., $2.75)

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!