Professional C programming utilities demonstrating loops, mathematical calculations, and data conversion. This project showcases fundamental programming concepts implemented with professional coding standards.
Loops-Tables-Loops/
├── src/ # Source code
│ ├── loops.c # Number range generator
│ ├── tables.c # Mathematical tables
│ └── conversion.c # Days to weeks converter
├── bin/ # Compiled executables
├── Makefile # Build configuration
└── README.md # This file
Generates a sequence of numbers starting from a user-specified value.
Features:
- Input validation and overflow protection
- Configurable range (default: 16 numbers)
- Professional error handling
Usage:
./bin/loops
Enter starting number: 10Creates formatted tables showing numbers, squares, cubes, and square roots.
Features:
- Customizable range (1-100)
- Formatted table output
- Mathematical calculations with proper data types
- Input validation
Usage:
./bin/tables
Enter lower limit (1-100): 1
Enter upper limit (1-100): 10Converts days to weeks and remaining days with proper pluralization.
Features:
- Interactive conversion loop
- Proper pluralization handling
- Overflow protection
- Decimal week calculation
Usage:
./bin/conversion
Enter number of days (positive to convert, 0 or negative to quit): 14- GCC compiler (C11 standard)
- Make utility
- Math library (libm)
# Build all utilities
make all
# Build individual utilities
make loops
make tables
make conversion
# Run tests
make test
# Clean build artifacts
make clean- Comprehensive input validation
- Overflow and underflow protection
- Clear error messages
- Graceful failure handling
- C11 standard compliance
- Professional naming conventions
- Comprehensive documentation
- Consistent formatting
- Proper data type usage for large calculations
- Overflow prevention in arithmetic operations
- Accurate floating-point calculations
=== Number Range Generator ===
Author: Jaden Mardini
Enter starting number: 5
Numbers from 5 to 21:
------------------------
5
6
7
...
21
------------------------
Total numbers: 17
=== Mathematical Tables Generator ===
Author: Jaden Mardini
Enter lower limit (1-100): 1
Enter upper limit (1-100): 5
+-----+----------+----------+---------+
| Num | Square | Cube | Sqrt |
+-----+----------+----------+---------+
| 1 | 1 | 1 | 1.00 |
| 2 | 4 | 8 | 1.41 |
| 3 | 9 | 27 | 1.73 |
| 4 | 16 | 64 | 2.00 |
| 5 | 25 | 125 | 2.24 |
+-----+----------+----------+---------+
=== Days to Weeks Converter ===
Author: Jaden Mardini
Enter number of days (positive to convert, 0 or negative to quit): 14
Conversion Result:
-----------------
14 days = 2 weeks and 0 days
That's approximately 2.00 weeks total
- Input Validation - All user input is validated
- Error Handling - Comprehensive error checking
- Code Clarity - Self-documenting code with clear logic
- Professional Standards - Industry-standard practices
- Mathematical Accuracy - Proper handling of calculations
Jaden Mardini - Computer Science Student
This project is for educational purposes.