again, thanks for the info guys you've been a great help so far..
but to re-iterate my original question i want the program to display an error message and ask for another number if the inputted number is outside the range I ask for..
so I ask anyone who knows, how would I modify my program below to do that? thanks
Code:#include <stdafx.h> #include <stdio.h> int main (void) { double number; do { Printf("Please enter a number between 2.5 and 6.5"); fflush(stdin); scanf("%lg", &number); }while ( (number <= 2.5) || (number>= 6.5) ); fflush(stdin); getchar(); return 0; }




Reply With Quote