hello there...i've been using this function to know if the input of the user is a number or a letter...but it's not working...
#include <iostream>
#include <math.h>
using namespace std;
double temp2;
int main(){
cout << "\n enter something";
cin >> temp2;
if(isnan(temp2)){
cout << "not a number \n";
}else{
cout << "a number \n";
}
return 0;
}
did i used it correctly or not?? help