Raw solution... you should be able to make the necessary
changes...it is a simple question. If you could operate just from 1
array is even better.
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
float *Numbers = NULL, BiggestNum = 0,Total, J[81];
int InputBuffer, I;
do
{
printf("Please Enter How Many Number You Want to subtract(1~80):
");
scanf(" %d", &InputBuffer);
} while( ( InputBuffer < 1 ) || ( InputBuffer > 80 )
);
Numbers = ( ( float * )calloc( InputBuffer, sizeof( float ) )
);
if( Numbers == NULL )
{
printf( "Failed to allocate the array. Exiting" );
system("pause");
return 1;
}
printf( "Enter number 1: ");
scanf( " %f", &J[80] );
printf( " ");
for( I = 0; I < InputBuffer-1; I++ )
{
printf( "Enter number %d: ", I+2 );
scanf( "%f", &Numbers[I] );
}
Total=J[80];
for( I = 0; I < InputBuffer; I++ )
Total -= Numbers[I];
printf( " Sum of the numbers entered is: %g ", Total );
getchar();
system("pause");
return 0;
}