Skip to content

godwin-binoy/Multiplication-Table

Repository files navigation

Multiplication Table

This project provides simple implementations of a multiplication table generator in Java, Python, and C. Users can input a number and view its multiplication table. The C program is newly added to the repository to enhance functionality and broaden the scope of implementations.

Features

  • Input Validation: Ensures user inputs are valid numbers.
  • Error Handling:
    • Prevents calculating the table for 0.
    • Prompts the user if invalid input is detected.
  • Iterative Display: Continuously prompts users to input numbers until manually terminated.

Technologies Used

  • Java (requires JDK 8 or higher)
  • Python (requires Python 3 or higher)
  • C (requires GCC or compatible compiler)

How to Run

Prerequisites

Ensure you have the following installed:

Steps to Execute

Python Implementation

  1. Clone the repository or download the Python script.
  2. Open a terminal and navigate to the script's directory.
  3. Run the script with the command:
    python multiplication_table.py
  4. Enter a number when prompted, and the multiplication table will be displayed.

Java Implementation

  1. Clone the repository or download the Java file.
  2. Navigate to the file's directory via terminal or command prompt.
  3. Compile the Java file with:
    javac multiplication_table.java
  4. Run the compiled file with:
    java multiplication_table
  5. Enter a number when prompted, and the multiplication table will be displayed.

C Implementation

  1. Clone the repository or download the C file.
  2. Open a terminal and navigate to the file's directory.
  3. Compile the program using GCC:
    gcc multiplication_table.c -o multiplication_table
  4. Run the compiled executable:
    ./multiplication_table
  5. Enter a number when prompted, and the multiplication table will be displayed.

Example Output

Input

Table of: 5

Output

Multiplication table
---------------------
1 × 5 = 5
2 × 5 = 10
...
10 × 5 = 50

Contributing

Contributions are welcome! If you have suggestions for improvements, feel free to fork the repository and submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

/~https://github.com/godwin-binoy