Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Programming questions