utakata
2008-10-27 12:23:29 UTC
function 2: print the 4 float values.
function 3: use the return statement to return the smallest of the 4 float values. print smallest value in the main.
function 4: swap the first and last of 4 float values. upon returning to the main, use your print function to print the float values after the swap has been completed. eg, if 4 float values are initially 2.2, 3.3, 4.4, 5.5, then the values printed after returning to the main should be 5.5, 4.4, 3.3, 2.2.
My question is where do I put return statement and swap function. I really don't know how to use return statement to find smallest value. I have done so far...can someone tell me how to add swap & return function? Thanks!
#include
void load (float *a, float *b, float *c, float *d)
{
printf("enter 4 floats ");
scanf("%f%f%f%f", &(*a), &(*b), &(*c), &(*d));
}
void print (float a, float b, float c, float d)
{
printf("The 4 values are %f %f %f %f\n\n",a,b,c,d)
}
void main()
{
float a, b, c, d;
load(&a,&b,&c,&d)
print(a,b,c,d)
}