Fading Coder

One Final Commit for the Last Sprint

Core Algorithm Implementations in C: Iteration, Recursion, and Constraint Solving

Computing the Greatest Common Divisor and Least Common Multiple Calculate the greatest common divisor (GCD) and least common multiple (LCM) for two positive integers provided by the user. #include <stdio.h> int compute_gcd(int first, int second) { while (second != 0) { int remainder = first %...

Implementing Core Computational Functions in C Programming

Task 1: Converting a Numerical Score to a Letter Grade The function grade_converter maps an integer score to a corresponding letter grade ('A' through 'E'). The functon takes an int parameter and returns a char value. A corrected implementation of a similar switch-case structure is shown below: char...

Solutions to Basic C Programming Exercises

Exercise 2-1: Programming in C is fun! This task requires printing a specific string to the console. #include <stdio.h> int main() { printf("Programming in C is fun!"); return 0; } Exercise 2-3: Output Inverted Triangle Pattern Prints an inverted triangle pattern using asterisks and...

Contact Book Implementation Using Singly Linked Lists and File I/O in C

Project File Structure (VS2022) ContactBook.h and ContactBook.c: Header and implemantation files for core contact book logic LinkedList.h and LinkedList.c: Header and implementation files for the singly linked list data structuer app.c: Test application to interact with the contact book via a menu i...

Implementing a Min-Heap Data Structure in C

A heap is a complete binary tree structure typically implemented using a dynamic array. This implementation focuses on a min-heap, where the root node holds the smallest value and each parent node is less than or equal to its children. Data Structure and Function Prototypes #ifndef HEAP_H #define HE...

C Programming Exercises on Arrays and Matrices

Task 1 #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #define SIZE 4 #define ROWS 2 void demo1() { int arr[SIZE] = {1, 9, 8, 4}; int i; // Output memory size of array arr printf("sizeof(arr) = %zu\n", sizeof(arr)); // Output address and value of each element for (i = 0; i < SI...

Practical Applications of Pointer Manipulation in C Programming

Fundamental Pointer Operations and Memory Addressing Pointers store memory addresses, allowing indirect access and modification of variables. The following implementation demonstrates pointer initialization, address assignment, dereferencing, and hexadecimal address printing. #include <stdio.h>...

Understanding Static and Dynamic Stack Implementations in C

Static Stack 1.1 Definition A static stack is a fixed-capacity stack data structure where the size is determined at creation time and cannot be modified during runtime. This implementation relies on a pre-allocated array to hold elements, and since memory is reserved during compilation, there's a p...

Understanding Arrays in C Language

Array Fundamentals An array is a collection of elements of the same type stored in contiguous memory locations. One-Dimensional Array Declaration // General syntax for array declaration element_type array_name[array_size]; The declaration requires three components: element_type: the data type of eac...

Comprehensive Guide to C Programming Fundamentals

Computer Systems and Programming LanguagesA computer system integrates hardware and software to perform complex calculations and logical operations. Hardware components include the Central Processing Unit (CPU), memory, and input/output devices, often based on the Von Neumann architecture where inst...