This is a simple C++ project that determines the type of a given number (Natural, Whole, Integer, Rational, or Irrational). This project was inspired by a review of the number system, and it serves as a way to test C++ programming skills.
This program prompts the user to input a number in different formats, such as:
- Integer (e.g.,
2
,-1
) - Decimal (e.g.,
3.14
) - Fraction (e.g.,
2/3
)
Based on the input, the program determines if the number is:
- A Natural number
- A Whole number
- An Integer
- A Rational number
- An Irrational number
- Input Handling: Accepts integers, decimals, and fractions as input.
- Number Classification: Uses mathematical functions to identify the type of number.
- User-Friendly Output: Displays the classification(s) of the input number.
- C++ Compiler (e.g., GCC)
- Basic knowledge of C++ and number systems
To compile and run the program:
g++ number_type_identifier.cpp -o number_type_identifier
./number_type_identifier