ok, almost got it.

Code:

#include <stdio.h>
#include <stdlib.h>
int main(void)
{
/*Local Definitions*/
int num;
int sum = 0;
int larg = 0;
int smal = 99998;
int less = 0;
int tween = 1;
int count = 0;
long avg;
/*Statements*/
printf("Enter numbers with <return> (99999 to stop):");
scanf("%d", &num);
while (num != 99999)
{
count++;
sum += num;
if (num < smal)
{
smal = num;
}
if (num > larg)
{
larg = num;
}
if (num < 20)
{
less = 1;
}
if( num <= 10 || num >= 90 )
{
tween = 0;
}
scanf("%d", &num);
}
avg = sum / count;
printf("The number of integers is: \t\t%d\n", count);
printf("The sum of the integers is: \t\t%d\n", sum);
printf("The average of the integers is: \t%d\n", avg);
printf("The smallest integer is: \t\t%d\n", smal);
printf("The largest integer is: \t\t%d\n", larg);
if (less = 1)
printf("At least one number was < 20: \tTrue\n");
else printf("At least one number was < 20: \tFalse\n");
if (tween = 1)
printf("All numbers were (10 <= n <= 90): \tTrue\n");
else printf("All numbers were (10 <= n <= 90): \tFalse\n");
system("PAUSE");
return 0;
}

The program works fine except it always prints "At least one number was < 20: True" and "All numbers were (10 <= n <= 90): True" even if the numbers were not true in those cases. Something wrong with my

Code:

if (less = 1)
printf("At least one number was < 20: \tTrue\n");
else printf("At least one number was < 20: \tFalse\n");
if (tween = 1)
printf("All numbers were (10 <= n <= 90): \tTrue\n");
else printf("All numbers were (10 <= n <= 90): \tFalse\n");

segment?

melee