im a beginer in C and im writing a program that ables the user to repeatedly enter positive and integers, until the user enters a value <=0. Then prints the min and max value entered.
I wrote the program but for some reason the min and max functions that i wrote don't work if some one can tell me where im going wrong with this it would be greatly appreciated.
thank you
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int i,max,min;
printf("enter an intiger: ");
scanf("%d",&i);
if (i>max)
max=i;
if (i<min)
min=i;
while (i>0 || i!=i)
{
printf("\nenter an integer: ");
scanf("%d",&i);
}
printf("\n\n the min # is: %d", min );
printf("\n\n the max # is: %d", max );
system ("pause");
return 0;
}