8.8k views
5 votes
Write a program that prompts a message to enter three double-precision floating-point numbers and passes these numbers from the main function to a function that returns the smallest number to the main function. The main function then prints the smallest number

User Hlim
by
8.1k points

1 Answer

5 votes

Final answer:

To write a program that prompts the user to enter three double-precision floating-point numbers and returns the smallest number, follow these steps.

Step-by-step explanation:

To write a program that prompts the user to enter three double-precision floating-point numbers and returns the smallest number, you can follow these steps:

  1. Create a function called findSmallestNumber that takes three double-precision floating-point numbers as input.
  2. Inside the function, compare the three numbers using conditional statements and variables.
  3. Return the smallest number.
  4. In the main function, prompt the user to enter three numbers and store them in variables.
  5. Call the findSmallestNumber function, passing the three numbers as arguments.
  6. Store the returned value in a variable.
  7. Print the smallest n
User Kashif Khan
by
8.5k points