#include <stdio.h>
#include <conio.h>
int main()
{
int answer, num, count = 0, total = 0, max = 0;
float average;
do
{
clrscr();
printf("Enter an integer: ");
scanf("%i", &num);
while ( count < 3 && num > 0 )
{
count=count + 1;
total += num;
if ( num > max )
{
max = num;
}
printf("Enter next integer: ");
scanf("%i", &num);
}
if ( count > 0 )
{
printf("\n");
printf("The maximum number is %i\n", max);
printf("the count is %i\n", count);
printf("the total is %i\n", total);
average= (float)total / count;
printf("the average in two decimal point is %.2f\n", average);
}
else
printf("No valid number were entered\n");
printf("Another run? Y/N ");
scanf("%i", &answer);
} while ( answer != 'N');
return(0);
}
i have problems doing the while loop! help me out if possible . .
unsure about while ( answer !- 'N')???
thanks mate