i wrote a function that check if the variable is integer or not but if I put double or float it give me that it`s integer can anyone help me
bool check(int a) {
if (a == (int)a) {
cout << "integer" << endl;
}
else {
cout << "not integer" << endl;
}
return 1 ;
}
void main() {
int a;
cout << "enter a number" << endl;
cin >> a;
check(a);
}