I am trying to create a program that gets the min and max of a list. I so far have this but when I run the program and put in a list i get the max, but the min is 0 because you have to end it with zero. How do i have that the 0 is not in the list.

#include <iostream>
#include <stdio.h>
#include "simpio.h"
#include "strlib.h"
#include "random.h"
using namespace std;

int main()
	int n, min, max;
	printf("Please enter a list of integers.\nSignal the end of your list with 0.\n");
	printf("Enter first number: ");
	n = GetInteger();
	if (n==0){
		printf("You did not enter any numbers.");
		min = n;
		max = n;
		while (n!=0)
			printf("Enter next number: ");
		n = GetInteger();
		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);

Is this a C or a C++ program. You posted on the C board so I can only assume it is C. In that case you need to delete lines 1 and 6, which are for c++ programs only.

As for the problem -- the while statement is incorrect while ( (n = GetInteger()) != 0)