Im having trouble with the smoothness of running this program. If you run it you will see the program right away. The program completes the task but uses a GetInteger function unnecessarily in the third line. Any help would be appreciated.
Here is the program
-------------------------------------
#include <stdio.h>
#include "simpio.h"
#include "genlib.h"
int main()
{
int n, min, max;
printf("Please enter a list of integers.\n");
printf("Signal the end of your list with 0.\n");
printf("Enter first number: ");
n=GetInteger();
{
min=n;
max=n;
while ((n=GetInteger())!=0)
{
printf("Enter next number: ");
if (n<=min)
min=n;
if (n>=max)
max=n;
}
printf("The maximum number in the list is %d.\n", max);
printf("The minimum number in the list is %d.\n", min);
}
}



LinkBack URL
About LinkBacks



