How to make sure input is a double in the C programming language
- by Chris_45
How do I make sure I've got a double and not something else?
int main() {
int flagOk = 0;
double number;
while(!flagOk) {
printf("Put in a double");
scanf("%lf", &number);
if(number == "%lf"); //this want make sure
flagOk = 1;
}
}