As PIEBALDConsult pointed out, you need to have a break condition, because otherwise your loop will run forever.

C++

int main(void) { int v, t, wc; while (1) /*Calculating the wind chill*/ { // Not a very good example, but you get the idea printf("Enter temp = 100 to exit.\n\n"); printf("Input temperature (<= 40° F) :...\n"); scanf_s("%d", &t); if (t == 100) break; printf("Input wind speed (>= 6 mph) :...\n"); scanf_s("%d", &v); if (t <= 40 && v >= 6) { wc = (int)(0.0817*(3.71*sqrt(v) + 5.81 - 0.25*v)*(t - 91.4) + 91.4); printf("The wind chill is %d degrees F.\n", wc); } else { printf("Number is out of range. Try again"); } } return 0; }

As for rounding up, use the function

`ceil()`

in `math.h`

For rounding down use

`floor()`

.Only casting to an int will truncate the value, hence 1.1 becomes 1.

For proper rounding you need to check if the value is smaller or larger than .5 and chose between ceil() and floor().

and wind speeds of 6 mph or greater.

Because I put if (t <= 40 && v >= 6) already, I thought putting 1 in the while loop is ok. Isnt it?

—SA