A collection of C programs I wrote while learning C in my 1st semester of engineering.
This repository contains C programming files created during my first semester as a Computer Science Engineering student.
The files cover foundational C concepts — from arithmetic operations and conditionals to loops, functions, arrays, recursion, and structure handling.
🔹 Basics & Operators
File | Description |
---|---|
C1_areaOfTriangle.c |
Area of triangle |
C2_averageFIveNumber.c |
Average of five numbers |
C3_arithematicOperator.c |
Arithmetic operations |
C4_relationOperator.c |
Relational operators |
C5_sizeDatatypes.c |
Size of datatypes |
C6_logicalOperator.c |
Logical operators |
🔹 Conditionals & Comparisons
File | Description |
---|---|
C7_greater10.c |
Check if number is greater than 10 |
C8_oddEven.c |
Check odd or even |
C9_greaterInteger.c |
Greater between two integers |
C10_greaterFloat.c |
Greater between two float numbers |
C11_greaterChar.c |
Greater between two characters |
C12_swapThreeVar.c |
Swap three variables |
C13_swapTwoVar.c |
Swap two variables |
C14_heightOfThree.c |
Tallest among three people |
C15_heightTernary.c |
Tallest using ternary operator |
C16_leapYear.c |
Leap year checker |
C17_ternary.c |
Ternary operator usage |
C18_marksLadderIf.c |
Grade classification using if-else |
🔹 Loops
File | Description |
---|---|
C20_nameForLoop.c |
Print name using for loop |
C21_nameWhileLoop.c |
Print name using while loop |
C22_firstFifty.c |
Print first 50 natural numbers |
C23_firstFiftyOdd.c |
Print first 50 odd numbers |
C24_sumAvgForLoop.c |
Sum & average using for loop |
C25_sumAvgWhileLoop.c |
Sum & average using while loop |
C26_sumAverageDoWhileLoop.c |
Sum & average using do-while loop |
C27_separateDigits.c |
Separate digits of a number |
C28_integerPalindrome.c |
Check palindrome |
C29_gcdLcm.c |
GCD and LCM of two numbers |
C30_factorialLoop.c |
Factorial using loop |
C31_break.c |
Example of break |
C32_continue.c |
Example of continue |
C33_multiplicationTable.c |
Multiplication table |
C41_primeLoop.c |
Prime number using loop |
🔹 Searching, Sorting & Arrays
File | Description |
---|---|
C34_bubbleSort.c |
Bubble sort |
C35_binarySearch.c |
Binary search |
C36_linearSearch.c |
Linear search |
C46_sumOfArray.c |
Sum of array elements |
🔹 Matrices
File | Description |
---|---|
C37_matrixMultiplication.c |
Matrix multiplication |
🔹 Functions
File | Description |
---|---|
C38_callByValue.c |
Call by value |
C39_callByReference.c |
Call by reference |
C40_typesOfFunctions.c |
Types of functions |
C42_primeFunctions.c |
Prime using function |
C43_factorialRecursion.c |
Factorial using recursion |
C44_fiboIterative.c |
Fibonacci using loop |
C45_fiboRecursive.c |
Fibonacci using recursion |
🔹 Structures
File | Description |
---|---|
C47_arrayOfStructure.c |
Array of structures |
C48_callByValueDotOperator.c |
Accessing structure with dot operator |
C49_callByReferenceArrowOperator.c |
Accessing structure with arrow operator |
🔹 Dynamic Memory Allocation
File | Description |
---|---|
C50_IntegerMalloc.c |
Dynamic memory allocation for integers using malloc |
C51_CharacterMalloc.c |
Dynamic memory allocation for characters using malloc |
C52_ArrayMalloc.c |
Dynamic memory allocation for arrays using malloc |
You can compile and run any program using GCC:
# Example for C9_greaterInteger.c
gcc C9_greaterInteger.c -o output
./output