Question: question about reading temperature in programming C language. I know In some cases it is better for a program just to keep reading values until

question about reading temperature in programming C language.

I know In some cases it is better for a program just to keep reading values until the user types in a finishing value such as -100.0

I want to write a new program called temperatures02. Then modify the code to:

initally allocate an array to hold up to5temperatures.

prompt the user to enter temperatures and type the value-100.0 when they finished

if the user fills up the array , the program should

dynamically allocate a new array which is double the size.

copy the old values across to the new array.

deallocate the old array.

continue reading into the new array.

After finish reading array , output the temperatures read in reverse (most recent to oldest).

for example : count =5 input 16.5 18.8 20.5 21.3 16.2 output should be 16.2 21.3 20.5 18.8 16.5

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 Programming Questions!