(Find the Minimum) Write a program that inputs three double-precision, floating-point numbers and passes them to a function that returns the smallest number.

What will be an ideal response?


```
// Determine the smallest of 3 numbers.
#include
using namespace std;

double smallest( double, double, double ); // function prototype

int main()
{
double x; // first input
double y; // second input
double z; // third input

cout << "Enter three numbers: ";
cin >> x >> y >> z;

// determine smallest value
cout << "The smallest value is " << smallest( x, y, z ) << endl;
} // end main

// smallest returns the smallest of a, b and c
double smallest( double a, double b, double c )
{
if ( a < b && a < c )
return a;
else if ( b < a && b < c )
return b;
else
return c;
} // end function smallest
```

Computer Science & Information Technology

You might also like to view...

The textx parameter of the CreditRoll.class specifies whether the text in the applet window is repeated.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

A ________ is text that helps to identify or explain a picture or graphic

A) caption B) title C) descriptor D) label

Computer Science & Information Technology

A footnote reference is indicated by a subscripted number

Indicate whether the statement is true or false

Computer Science & Information Technology

Word automatically applies 11-point type to footnotes.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology