/csc121-course-work

CSC121(Software Workshop) course work for University of Lagos 🎓. This project utilizes C to perform various algorithms and calculations ranging from simple to complex.

Primary LanguageCMIT LicenseMIT

Software Workshop Course Work

Project Overview

This repository contains the coursework assignments for CSC121 at the University of Lagos. Each C program included here serves a unique purpose, demonstrating fundamental concepts in C programming.

Table of Contents

Files

1. calculate-pi.c

This program calculates the value of Pi using a specified number of iterations of a series.

2. car-pool-calculator.c

This program calculates carpool savings by taking into account factors like distance traveled, fuel cost, and car efficiency.

3. condition-test.c

This program tests various conditional statements and demonstrates their usage in different scenarios.

4. digit-separator.c

This program separates the digits of an integer and prints each digit on a new line.

5. even-odd.c

This program checks if a number is even or odd.

6. increment-demo.c

This program demonstrates the usage of increment and decrement operators.

7. prime-checker.c

This program checks if a given number is a prime number.

8. prime-numbers.c

This program prints all prime numbers up to a specified limit.

9. sum-multiples.c

This program calculates the sum of multiples of a specified number up to a given limit.

10. triangle-area.c

This program calculates the area of a triangle given its base and height.

Getting Started

Prerequisites

To run these programs, you need to have a C compiler installed on your system. You can use GCC, which is available for most operating systems.

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/CSC121-coursework.git
  2. Navigate to the repository directory:
    cd CSC121-coursework

Compilation

To compile any of the C programs, use the following command:

gcc -o output_name source_file.c

# For example, to compile calculate-pi.c, you would use:

gcc -o calculate-pi calculate-pi.c

Usage

To run the compiled program, use the following command:

./output_name

# For example, to run the compiled calculate-pi program, you would use:

./calculate-pi

License

This project is licensed under the MIT License - see the LICENSE file for details.