https://github.com/rkstudio585/palindrome-checker-c
Palindrome Checker is a C program that determines if a string reads the same forward and backward. It ignores non-alphanumeric characters and is case-insensitive. The program runs in a loop, allowing multiple checks, and provides clear results and prompts to continue or exit.
https://github.com/rkstudio585/palindrome-checker-c
c-project c-script palindrome palindrome-c palindrome-c-script palindrome-checker palindrome-number palindrome-string
Last synced: 6 months ago
JSON representation
Palindrome Checker is a C program that determines if a string reads the same forward and backward. It ignores non-alphanumeric characters and is case-insensitive. The program runs in a loop, allowing multiple checks, and provides clear results and prompts to continue or exit.
- Host: GitHub
- URL: https://github.com/rkstudio585/palindrome-checker-c
- Owner: rkstudio585
- License: other
- Created: 2024-09-08T09:29:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-08T09:33:46.000Z (over 1 year ago)
- Last Synced: 2024-12-28T20:14:12.737Z (over 1 year ago)
- Topics: c-project, c-script, palindrome, palindrome-c, palindrome-c-script, palindrome-checker, palindrome-number, palindrome-string
- Language: C
- Homepage: https://rkstudio.com
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Palindrome Checker Program π΅οΈββοΈ
---
[In Python](https://github.com/mdriyadkhan585/palindrome-checker-python)
[In Python GUI](https://github.com/mdriyadkhan585/palindrome-checker-gui)

---
Welcome to the Palindrome Checker program! This C application checks whether a given string is a palindromeβa word, phrase, or sequence that reads the same backward as forward. Follow the instructions below to use and understand this program.
## Features β¨
- **Checks for Palindromes**: Determines if the input string reads the same forward and backward, ignoring non-alphanumeric characters and case.
- **User-Friendly Loop**: Allows multiple checks in one run of the program.
- **Input Validation**: Handles empty strings and provides informative messages.
## How to Use π
### Compilation βοΈ
1. Ensure you have a C compiler installed (e.g., `gcc`).
2. Save the code into a file named `palindrome_checker.c`.
```bash
git clone https://github.com/mdriyadkhan585/palindrome-checker-c
cd palindrome-checker-c
gcc -o palindrome_checker palindrome_checker.c
```
This command compiles the code and generates an executable named `palindrome_checker`.
### Running the Program π
1. Run the compiled executable.
```bash
./palindrome_checker
```
2. The program will prompt you to enter a string.
3. After you enter a string, it will determine if the string is a palindrome and display the result.
4. You will then be asked if you want to check another string. Type `y` or `Y` to continue, or `n` or `N` to exit.
### Example Usage π₯οΈ
```plaintext
Enter a string: A man a plan a canal Panama
The input string is a palindrome.
Do you want to check another string? (y/n): y
Enter a string: Hello, World!
The input string is not a palindrome.
Do you want to check another string? (y/n): n
Exiting the program.
```
## Code Overview π
### `isPalindrome` Function π
- **Purpose**: Checks if the string is a palindrome.
- **How It Works**:
- Uses two pointers to compare characters from the start and end.
- Skips non-alphanumeric characters and ignores case.
### `main` Function π
- **Purpose**: Manages user input and interaction.
- **Features**:
- Reads the input string.
- Removes the newline character.
- Checks if the string is empty and prompts the user accordingly.
- Asks if the user wants to check another string.
## Troubleshooting π οΈ
- **Input Issues**: If you encounter errors reading input, ensure your environment supports `fgets`.
- **Compilation Errors**: Make sure you have a compatible C compiler and that the code is saved correctly.
## Contributing π€
Feel free to contribute by improving the code or adding features. Submit pull requests or suggestions via [GitHub](https://github.com/mdriyadkhan585).
## License π
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---