Hello all!
Well I seem to have reached a boiling point -- I programmed my array to take 10 numbers and print them out but i dont know how to have them print in ascending order and then take those same 10 numbers and print the average .. yeah i've been doin this for so long i've confused myself!
CODE
# include <stdio.h>
int ask_for_numbers ( float [ ], int );
void display_float ( float *, int );
void main( void )
{
int elements_count;
float F_array[10];
elements_count = ask_for_numbers ( F_array, 10 );
display_float ( F_array, elements_count );
}
int ask_for_numbers ( float ar[ ], int size )
{
float number = 1.1;
int count = 0;
printf ("\n-->Input: Max of 10 numbers\n");
printf ("\nEnter 10 Numbers or '0' to exit program.\n");
while ( number != 0.0 && count < size )
{
printf ( "%d: ", count + 1 );
scanf ( "%f", &number);
if ( number != 0.0 )
ar[count++] = number;
}
return ( count );
}
void display_float ( float *ar, int size )
{
int index;
printf ("\n--> Your output is:\n");
for ( index=0; index < size; ++index )
printf ("[%.1f] ", *ar++ );
printf ("\n");
return;
}
and yeah it works now -- i just need some, no wait, ALOT of help
--> so go ahead and chop it up if you need to, whatever helps will b good - thanks