Question: C PROGRAMMING Create a program that adds positive real numbers (double) entered by the user until the user enters a negative number. The program calculates

C PROGRAMMING

Create a program that adds positive real numbers (double) entered by the user until the user enters a negative number. The program calculates the average of the entered positive numbers and prints the average to two decimal places. (Also try how the program behaves when you "forget" to read the data in front of the variable name.) Execute the program with the while structure. The program checks whether the user enters data that can be interpreted numerically. If the user enters incorrect information, the program will ask for the number again. If the user enters an incorrect input three times, the program notifies the user of the failure of the input number and the program is stopped. Example of running invalid inputs (normal case is similar to previous tasks): Enter a real number (negative value terminates)> adf There was no real number There was no real number There was no real number Invalid entry number 1 Invalid, please try again! > d There was no real number Invalid entry number 2 Invalid, please try again! > g There was no real number Invalid entry number 3 Invalid input three times. The program is terminated

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!