#include<stdio.h>
#include <limits.h>
int main()
{
int value;
int smallest = INT_MAX;
printf("This is a program that finds out the minimum \nof serveral integers you entered.");
printf("Please type in these integers: ");
while(scanf("%d", &value) != EOF)
{
printf(" ");
if(value <= smallest)
{
smallest = value;
printf("%d", smallest); // to trace the while loop
}
}
printf("\nThe smallest integer is: %d", smallest); // this will execute once the program is stopped
return 0;
}
#include<stdio.h>
#include <limits.h>
int main