Skip to content

Latest commit

 

History

History
63 lines (47 loc) · 2.56 KB

File metadata and controls

63 lines (47 loc) · 2.56 KB

C Programming Solutions Repository

Overview

This repository contains a collection of C source files, including solutions to various LeetCode problems and lab assignments. Each file is designed to solve specific coding challenges, demonstrate programming concepts, and provide practical examples of algorithmic approaches.

Content Structure

The repository consists of the following files:

LeetCode Solutions

  • Leetcode1.c : Solution for LeetCode problem 1.
  • Leetcode2.c : Solution for LeetCode problem 2.
  • Leetcode3.c : Solution for LeetCode problem 3.
  • Leetcode4.c : Solution for LeetCode problem 4.
  • Leetcode5.c : Solution for LeetCode problem 5.
  • Leetcode6.c : Solution for LeetCode problem 6.
  • Leetcode7.c : Solution for LeetCode problem 7.
  • Leetcode8.c : Solution for LeetCode problem 8.
  • Leetcode9.c : Solution for LeetCode problem 9.
  • Leetcode10removeduplicates.c : Solution for LeetCode problem 10 - Remove Duplicates from Sorted Array.

Lab Assignments

  • Lab assignment.cpp : Implementation of lab assignment requirements in C++.
  • arrayofnum.c : A program to handle and manipulate arrays of numbers.
  • factorials.c : Computes the factorial of a given number.
  • floattoint.c : Conversion of float to integer.
  • gpa2.c : Calculates GPA based on provided grades.
  • inversematrix4.c : Computes the inverse of a 4x4 matrix.
  • matrix.c : Various matrix operations.
  • mean12.c : Calculate the mean of a set of numbers.
  • oddeven.c : Determines if numbers are odd or even.
  • primeorcomposite.c : Checks if a number is prime or composite.
  • productn.c : Product of numbers in a given range.
  • program2_3.c : Renamed from revnum.c; demonstrates reversal of a number.
  • readprintxt.c : Reads and prints text from a file.
  • readtxtfile.c : Reads data from a specified text file.
  • recfunction.c : Demonstrates recursive functions.
  • revnum.c : Reverses a number.
  • sortingfile.c : Sorts contents of a file.
  • sum and average.c : Computes the sum and average of a given dataset.
  • transposematrix.c : Transposes a given matrix.

Getting Started

To use the files in this repository, follow these steps:

  1. Clone the Repository :
    bash
    git clone https://github.com/sanjayjr8/LeetCode Algorithms and Problems.git

  2. Compile the Code: Use a C compiler (like gcc) to compile the .c files:

gcc -o output_filename filename.c

3.Run the Program: After compiling, run the generated executable: ./output_filename