Thank you guys for your support, I have found that the program i have is not efficient and it has some bugs, because when i enter numbers equal numbers example: num1= 44, num2 =44, num3= 44, num4= 44. It wont print nothing.
The best way to do it with out doing an array is how Dave_Sinkula posted. I have modified the code, but i have a problem it dosent print the minimun number. It just prints a crazy number but the maximum number works fine.
can some one point out where is the error?
Code:
#include <stdio.h>
int main()
{
int i,MAX_INTS=4,value,min,max; /* instead of an array */
for ( i = 0; i < MAX_INTS; i++ )
{
printf("\nEnter a number: "); /* prompt and user input into value */
scanf("%d",&value);
if ( value < min )
{
min = value;
}
if ( value > max )
{
max = value;
}
}
printf("min = %d, max = %d\n", min, max);
return 0;
}
Thank you guys