Skip to content

sadiapeerzada/C-Programs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

C-Programs

A curated repository of C programs demonstrating core programming concepts, data structures, algorithms, and problem-solving techniques in C.

🖥️ C Programming Repository

📖 Overview

This repository contains all C programs and lab assignments from Semester 1 and Semester 2 of my computer science course.

It provides a structured learning path from basic C programming concepts to advanced data structures and algorithms.

All programs are well-commented, organized by week and topic, and intended as a reference for students and coding enthusiasts.


⚙️ Development Environment

  • Tool Description
    💻 Compiler GCC (GNU Compiler Collection)
    🖊 Editor VS Code, Code::Blocks, Dev C++
    🌐 Language C
    🖥 Platforms Windows, macOS, Linux
    🔗 Version Control Git & GitHub

🗓️ Semester 1 – Fundamentals of C Programming

Semester 1 focuses on core C concepts, including:

  • Variables, constants, and data types
  • Operators and expressions
  • Control flow: loops and conditional statements
  • Functions and recursion
  • Arrays and strings
  • Pointers and dynamic memory
  • Structures, unions, and file handling

🔹 Week 1 – Basic Programs & I/O

Topics Covered:

  • Program structure
  • Input/output using printf and scanf
  • Basic arithmetic operations

Example Files:

  • ASCIIValueOfCharacter.cpp
  • Add2DistancesEnteredByUser.cpp
  • Add2MatricesofOrderN.cpp
  • AreaAndPerimeterOfDiff.Shapes.cpp

🔹 Week 2 – Decision Making & Loops

Topics Covered:

  • Conditional statements (if, else, switch)
  • Looping constructs (for, while, do-while)
  • Nested loops and pattern printing

Example Files:

  • CheckNo.PrimeOrNot.cpp
  • FabonaccciSeries.cpp
  • FactorialOfAGivenInteger.cpp
  • FactorialOfNumber.cpp
  • FibonacciSeriesUptoNUsingRecursion.cpp
  • FindArmstrongNo.InRange0to999.cpp

🔹 Week 3 – Arrays & Strings

Topics Covered:

  • Single and multi-dimensional arrays
  • String manipulation
  • Searching and matrix operations

Example Files:

  • CountEven(int,int)RecievesIntegerArray.cpp
  • ToFindLargestElementOfGivenArray.cpp
  • SumOfArrayElements.cpp
  • SortArrayInAscendingOrder.cpp
  • ToPerformOperationOnStringsUsingStringFunc..c
  • ToRemoveAllVowelsFromString.c

🔹 Week 4 – Functions & User-Defined Operations

Topics Covered:

  • Creating and using functions
  • Parameter passing by value and reference
  • Modular programming

Example Files:

  • UserDefinedFunc.ToExchangeValuesOf2Variables(USING 3rd VARIABLE).cpp
  • UserDefinedFunc.ToExchangeValuesOf2Variables(WITHOUT USING 3rd VARIABLE).cpp
  • UsesFunctionsToPerformOperations.c

🔹 Week 5 – File Handling

Topics Covered:

  • Creating, reading, writing, and appending files
  • Error handling in file operations

Example Files:

  • CreateAFile&StoreSomeInfo.cpp
  • ReadDataFromFile.cpp
  • ConcertAllContentOfTextFileToUppercase.cpp
  • CountNo.OfLines,Char,BlankSpaces.cpp

🔹 Week 6 – Pointers & Dynamic Memory

Topics Covered:

  • Pointer arithmetic
  • Dynamic memory allocation (malloc, calloc, realloc, free)
  • Using pointers with arrays and structures

Example Files:

  • StoreElementsInArrayPrintElementUsingPointer.cpp
  • ToStoreInfoUsingStructures,PointerWithDynamicallyMemoryAllocation.c

🔹 Week 7 – Structures & Records

Topics Covered:

  • Structures for data storage
  • Arrays of structures
  • Employee/student record management

Example Files:

  • ToStoreStudent'sInformation(UsingStructure).c
  • ProgramToAccept5RecordsOfEmployees.cpp
  • StoreRecordOfStidentsTheirDetails.cpp
  • StoreRecordsOfNStudentsOfClassArrangeRankwise.cpp

🗓️ Semester 2 – Data Structures & Algorithms in C

Semester 2 emphasizes data structures and algorithm implementation, including:

  • Stacks, queues, and circular queues
  • Linked lists (singly, doubly, circular)
  • Trees and traversal algorithms
  • Expression evaluation
  • Sorting and searching algorithms

🔹 Week 1 – Stacks & Queues

Example Files:

  • ThatImplementsStackAndItsOperationsUsingArray,LinkedLists(Pointers).c
  • ThatImplementsQueueAndItsOperationss.c
  • ThatImplementsCircularQueueUsingArrays.c

🔹 Week 2 – Linked Lists

Example Files:

  • ToPerformOperationsOnASinglyLinkedList.c
  • ToPerformOperationsOnADoublyLinkedList.c
  • ToPerformOperationsOnACircularLinkedList.c

🔹 Week 3 – Advanced Structures

Example Files:

  • ToAdd2Distances(UsingStructure).c
  • ToAdd2ComplexNo.ByPassingStructureWithFunc..c
  • ToCalculateTheDifferenceBtw2TimePeriods.c

🔹 Week 4 – Stacks/Queues & Expression Evaluation

Example Files:

  • ToConvertTheInfixExpressionIntoPostfixExpression.c
  • ToEvaluatePostfixExpression.c

🔹 Week 5 – Advanced Arrays, Sorting & Searching

Example Files:

  • ToMerge2SortedArraysInto1Array.c
  • ToPerformTheDiffSortingMethods.c
  • BinarySearch.cpp

🔹 Week 6 – Miscellaneous

Example Files:

  • ToFindNo.OfVowels,Consonants,DigitsAndWhiteSpace.c
  • ToRemoveGivenWordFromString.c
  • UsesBothRecursiveAndNon-RecursiveFunctions.c

🛠 How to Clone and Run

Clone the repository:

git clone https://github.com/<your-username>/<repo-name>.git
Navigate to the repository folder:

bash
Copy code
cd <repo-name>
Compile a program:

bash
Copy code
gcc Semester_1/Week_1/ASCIIValueOfCharacter.cpp -o ascii
Run the compiled program:

Linux/macOS: ./ascii

Windows: ascii.exe

Example Output:

less
Copy code
Enter a character: A
ASCII value: 65
pgsql
Copy code

About

A curated repository of C programs demonstrating core programming concepts, data structures, algorithms, and problem-solving techniques in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors