Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool integerCheck(double);
- int main()
- {
- for(;;){
- double value;
- cout << "Insert Number:" << endl;
- cin >> value;
- if (integerCheck(value) == true ){
- cout << "The inserted number was an integer! \n\n";
- } else {
- cout << "The inserted number was NOT an integer! \n\n";
- }
- }
- return 0;
- }
- bool integerCheck(double x){
- if(x == int(x)){
- return true;
- } else {
- return false;
- }
- }
Add Comment
Please, Sign In to add comment