/*Program takes values from user
and tells which one was highest and which one was smallest*/
#include<stdio.h>
#include<conio.h>
main()
{
int num = 0, smallest=0, highest = 0, counter = 0;
while (num != -1)
{
printf("Please enter the number or -1
to see results: ");
scanf("%d",&num);
if ((smallest >= num && num
!=-1) || (counter==0))
{
smallest = num;
}
if ((highest <= num && num !=
-1)||(counter == 0))
{
highest = num;
}
counter++;
}
printf("\nSmallest entered value is: %d
\nand the highest entered value is: %d \n\nSo the range is %d",smallest,highest,(highest-smallest));
getche();
}