0

I have a homework question and I don't know quite where to start or how to implement what she is asking:

Write a program that inputs three double-precision, floating-point numbers and passes them to a function that returns the smallest number.
.
Can someone please help me to figure this out

4
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by sohaibrazzaq
0

do you know what a "double precision floating point" is? If you don't know what it is then look it up in the index of your text book. It should explain the different data types to you.

in main() function, declare three variables of that type. Write that much of the program, post your program and ask questions if you have problems.

0

Use arrays and bubble sort.

If not there is a deviously complicated flow chart for find the minimum of three numbers with just if statements.

0

Hi!
This is the source code for a program which will find minimum from 3 floating point numbers, atleast it will give you some idea.

#include <conio.h>
#include <stdio.h>
float minimum( float x, float y, float z);
int main()
{
float a , b , c;
clrscr();
printf("Enter three Numbers to find Minimum Number:\n");
scanf("%f%f%f", &a, &b, &c);
printf("Minimum Number is : %f\n", minimum(a, b, c));
getche();
return 0;
}
float minimum(float x, float y, float z)
{
float min = x;
if (y < min)
min = y;
if (z < min)
min = z;
return min;
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.