I'm creating a program that will test a range of temperatures for validity. I have become stuck, in this case am trying to print a message saying invalid input when a user enters a value not in the range of 425 - 435.
Code:#include <stdio.h> #define sentinel 999 int main(void) { int temp; double valid; printf ("Enter the number 999 when you are finished entering numbers.\n\n"); printf ("Enter the temperature range :", sentinel); scanf("%d", &temp); while (temp != sentinel ) { valid = 1; while (valid) { if (temp > 425 && temp < 435) valid = 0; } printf("The product cure temperature is good!\n"); break; } return (0); }



LinkBack URL
About LinkBacks



