Skip to content

GargiMittal/c-codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C-Codes Repository

Collection of C programming projects solved in first year, organized by labs and practice exercises. This repository contains fundamental C programming concepts from basic I/O to advanced data structures.


📁 Lab 1: Basic Input/Output & Hello World

File Description
HelloWorld.c First C program printing hello world and introduction
myInfo.c Display personal information (roll no., name, phone, percentage)
5sentence.c Print 5 sentences about personal background

📁 Lab 2: Basic Arithmetic Operations

File Description
marksAvg.c Calculate sum and average of two marks

📁 Lab 3: Functions & Conditionals

File Description
project1.c Conditional logic with function calls (if-else)
project2.c Factorial calculation using recursive functions
project3.c Count vowels and consonants in a string
23.c Hello world using function calls

📁 Lab 4: Geometric Calculations

File Description
E5.c Calculate area and circumference of a circle
E6.c Calculate triangle area using Heron's formula
E7.c Calculate simple interest with fixed rate (8%)
E8.c Calculate compound interest using power function

📁 Lab 5: Conditional Statements

File Description
E13.c Check if number is divisible by 3 or 5
E14.c Determine if character is uppercase, lowercase, or digit
E15.c Check if number is positive, negative, or zero
E16.c Check voting eligibility based on age (≥18)

📁 Lab 6: Switch Statements & Loops

File Description
E18.c Check if number is odd or even using switch
E19.c Calculator using switch for arithmetic operations
E20.c Salary calculator with increment percentages
E21.c Convert day number to day name (1=Sunday...7=Saturday)
E22.c Assign grade based on marks using switch
E23.c Find greatest number among three using ternary operator
program12.c Sum of n integers input by user
program13.c Factorial calculation using loop
program14.c Matrix input and display

📁 Lab 7: Nested Loops & Patterns

File Description
16A.c Print right-aligned star triangle pattern
16B.c Print center-aligned star triangle pattern
16C.c Print alphabet triangle pattern (A, B, C...)
16D.c Print spaced star triangle pattern
16e.c Print alphabet triangle with spacing
16F.c Print alphabet triangle with decreasing pattern
16G.c Print diamond pattern using hash symbols
E24.c Calculate factorial using loop
E25.c Display ASCII character table (all 256 values)
E26.c Print multiplication table for a given number
P17.c Calculate GCD and LCM of two numbers

📁 Lab 8: Series Calculations & Number Analysis

File Description
E27.c Sum of harmonic series: 1+1/2+1/3+...+1/n
E28.c Sum of alternating series: 1²-3²+5²-7²+...
E29.c Sum of squares: 1²+2²+3²+...+n²
E30.c Sum of power series with custom base and exponents
E31.c Calculate sum of all digits in a number
E32.c Check if number is Armstrong number (narcissistic)
E33.c Sum integers until 0 is entered (do-while loop)
E34.c Convert character case until '$' is entered

📁 Lab 9: Arrays & Array Operations

File Description
E35.c Input and display array elements
E36.c Sort array using bubble sort algorithm
E37.c Count even, odd, and prime numbers in array
E38.c Find largest and smallest numbers in array
E39.c Reverse an array
E40.c Merge two arrays
E41.c Search element in array (linear search)
E42.c Copy array to another array
E43.c Swap two arrays
E44.c Insert element at specified location in array
E45.c Delete element from array
P18.c Calculate sum and average of 10 numbers
P19.c Find largest number in array

📁 Lab 10: 2D Arrays & Matrix Operations

File Description
E45.c Matrix input and display
E46.c Matrix addition operations
E47.c Matrix input and print
E48.c Matrix transpose (rotate rows and columns)
E49.c Sum of lower triangle matrix
E50.c Sum of upper triangle matrix
E51.c Sum of diagonal elements
E52.c Sum of all matrix elements
E53.c Check if matrix is magic square
E54.c 3x3 matrix multiplication

📁 Lab 11: String Operations

File Description
E56.c Convert string to uppercase (manual method)
E57.c Count vowels in a string
E58.c Find frequency of a character in string
E59.c Convert string to uppercase (using toupper)
E60.c Convert string to lowercase (using tolower)
E61.c Copy string using strcpy()
E62.c Concatenate two strings using strcat()
E63.c Calculate string length using strlen()
E64.c Reverse string using strrev()
lab 11 E68.c Display reversed string
p20.c Check if string is palindrome
p21.c Find character frequency in string
p22.c Calculate string length (manual count)

📁 Lab 12: Advanced String & Data Operations

File Description
E65.c String output demonstration
lab 12 E65.c String comparison (lexicographic order)
lab 12 E66.c String length (manual implementation)
lab 12 E67.c Sum of ASCII values in string
lab 12 E69.c Count vowels, words, and digits
lab 12 E70.c Sort array of strings alphabetically
lab 12 E71.c Delete character from string
lab 12 E 72.c Concatenate strings with comma separator
lab 12 E73.c Copy string manually
lab 12 E74.c Check if string is lowercase only
lab 12 E75.c Check if string is uppercase only
lab 12 E76.c Count uppercase and lowercase letters

📁 Practice Folder: Additional Practice Programs

File Description
add2no.c Addition of two numbers
calculator.c Simple calculator with multiple operations
count.c Count and print numbers from 1 to n
divide2no.c Division of two numbers
funniE49.c Lower triangular matrix operations
greatest5.c Find largest among 5 numbers
hello world.c Hello world variation
numberprint.c Read and print number
practice1.c Sorting array (selection sort)
rectangle.c Rectangle area calculator
sub2no.c Subtraction of two numbers
test1.c Infinite loop test program
xyz.c Delete character from string

📚 Topics Covered

Topic Concepts Files
Basic I/O printf, scanf, output formatting Lab 1-2
Data Types & Variables int, float, char, arrays, operators All labs
Control Flow if-else, switch-case, ternary operator Lab 5-6
Loops for, while, do-while, nested loops Lab 6-8
Functions Declaration, definition, recursion, parameters Lab 3, 7
Arrays 1D arrays, array operations, sorting, searching Lab 9
2D Arrays/Matrices Matrix operations, transpose, addition, multiplication Lab 10
Strings String input/output, manipulation, case conversion Lab 11-12
Mathematical Operations Series summation, interest calculations, number properties Lab 4, 8
Patterns & ASCII Pattern printing, ASCII values, character operations Lab 7

💡 How to Use

  1. Navigate to any lab folder to view programs for specific topics
  2. Each file contains C code with comprehensive comments explaining the program's purpose
  3. Use these programs to understand fundamental C concepts progressively
  4. Compile and run: gcc filename.c -o output && ./output

Quick Navigation

  • Beginners: Start with Lab 1 → Lab 2 → Lab 3 → Lab 4
  • Control Flow: Lab 5 → Lab 6 → Lab 7
  • Data Structures: Lab 9 (Arrays) → Lab 10 (Matrices) → Lab 11-12 (Strings)
  • Practice: Check the Practice Folder for supplementary exercises

📊 Repository Statistics

Metric Count
Total Labs 12
Total Files 100+
Difficulty Level Beginner to Intermediate
Programming Language C

About

Collection of all the labs of C Language (basic Level)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages