Skip to content

XDream8/misc-c-projects

Repository files navigation

Misc C Projects

A collection of lightweight terminal utilities written in C. These projects focus on efficiency and clear functional logic for mathematical calculations and unit conversions.

Project List & Objectives

1. Circle Calculator (circle-calculator)

Objective: Calculate the geometric properties of a circle.

  • Functionality: Computes Area, Circumference, Surface Area and Diameter based on user-provided radius.
  • Mathematical Basis: Uses standard geometric formulas ($A = \pi r^2$; $C = 2\pi r$).

2. Compound Interest Calculator (compound-interest-calculator)

Objective: Project investment growth over time.

  • Functionality: Calculates the final balance based on principal, interest rate, time duration, and compounding frequency.
  • Mathematical Basis: Implements the formula $A = P(1 + \frac{r}{n})^{nt}$.

3. Weight Converter (weight-converter)

Objective: Convert mass measurements between Metric and Imperial systems.

  • Functionality: Handles conversions between kilograms/grams and pounds/ounces.
  • Mathematical Basis: Uses high-precision conversion constants.

4. Temperature Converter (temperature-converter)

Objective: Provide quick unit transitions between temperature scales.

  • Functionality: Supports bi-directional conversion between Celsius, Fahrenheit and Kelvin.
  • Mathematical Basis: Uses precise floating-point arithmetic for accurate scaling.

Technical Overview

  • Performance-Oriented: Written to minimize overhead and maximize execution speed.
  • Portability: Adheres to standard C libraries for compatibility across different environments.
  • Minimalist Logic: Focuses on clear, direct implementation of tasks.

Build and Run

Using Make

To compile and run any of these projects using the provided Makefile:

$ make <project_name>
$ make circle-calculator
$ make temperature-converter

Manual Compilation

Alternatively, navigate to the specific directory and use gcc or clang:

  • using gcc
$ gcc main.c -o output_binary -lm
$ ./output_binary
  • using clang
$ clang main.c -o output_binary -lm
$ ./output_binary

Releases

No releases published

Packages

 
 
 

Contributors