how do you promt the program from positive integars terminatd by -1 .. and then ask for smallest of these integars.
I did everything except when I add (!= EOF) .. It shows the same prompt multiple times
should I still keep the code or is there a specific error?
#include <stdio.h>
int
main (void)
{
int n, smallest, i=1;
while (n != EOF)
{
printf ("Enter a list of positive integars: ",i);
scanf ("%d", &n);
if (n<=smallest)
smallest=n;
i++;
}
printf("The smallest of these integars is %d.\n ");
return (0);
}