https://github.com/yastechub/hng12_task1
https://github.com/yastechub/hng12_task1
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/yastechub/hng12_task1
- Owner: YastecHub
- Created: 2025-02-05T14:15:12.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2025-02-05T15:29:25.000Z (4 months ago)
- Last Synced: 2025-02-05T15:30:12.979Z (4 months ago)
- Language: C#
- Size: 847 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HNG12 Stage 1 - Public API
This is a simple public API developed for the HNG12 Internship Stage 1 task.## Number Classification API
This API classifies numbers based on their mathematical properties and returns a fun fact.
### 🚀 Features:
- Checks if a number is **prime, perfect, or Armstrong**.
- Determines if it is **odd/even**.
- Calculates the **digit sum**.
- Fetches a **fun fact** from the Numbers API.### 📌 Endpoint:
#### `GET /api/classify-number?number=371`
Example Response:
```json
{
"number": 371,
"is_prime": false,
"is_perfect": false,
"properties": ["armstrong", "odd"],
"digit_sum": 11,
"fun_fact": "371 is an Armstrong number because 3^3 + 7^3 + 1^3 = 371"
}