Loading...
Loading...
Master C programming with our comprehensive collection of practical examples. Each program includes detailed explanations, step-by-step execution, and sample outputs.
Clone, download, or fork all 187+ programs in one place
Fundamental C programs for beginners
The classic first program in C
Display name entered by user
Read and display an integer
Add two integers entered by user
Determine if a number is prime
Multiply two decimal numbers
Get ASCII value of a character
Swap values using temp variable
Temperature conversion program
Temperature conversion program
Find size of data types using sizeof
Add complex numbers using structures
Display all primes up to N
Calculate simple interest
Calculate compound interest
Calculate area and perimeter
Calculate area and circumference
Decision making, loops, and conditional programs
Determine sign of a number
Determine if number is even or odd
Character classification
Alphabet, digit, or special char
Convert uppercase to lowercase
Find maximum among three numbers
Determine if year is leap year
Calculator using switch-case
Calculate 1+2+3+...+n
Display all alphabets
Generate multiplication table
Calculate average of user inputs
Calculate percentage and grade
Menu-driven program using do-while
Control loop execution flow
Count number of digits
Calculate sum of all digits
Reverse digits of a number
Calculate x^n using loop
Calculate n! using loop
Print Fibonacci sequence
Find all divisors
Find greatest common divisor
Find least common multiple
Sum of divisors equals number
Number reads same forwards/backwards
Verify Armstrong property
Find all Armstrong numbers in range
Find Armstrong numbers in given range
Check if sum of digits squared equals number
Sum of digit factorials equals number
Prime check using loops
Print primes between two numbers
Print primes in a range
Sum Fibonacci at even positions
Star, number, and character patterns
Print pyramid of stars
Print right-angled triangle
Print rotated pyramid
Print inverted star pyramid
Print pattern with numbers
Print pattern with alphabets
Print continuous alphabet pattern
Print hollow pyramid
Print inverted hollow pyramid
Print hollow diamond pattern
Print full diamond shape
Print Pascal triangle
Print Floyd triangle
Print reversed Floyd triangle
Functions and recursive programs
Function to check prime
Print primes using function
Find roots using formula
Express number as sum of primes
Sum using recursion
Recursive factorial calculation
Euclidean algorithm recursive
Reverse stack recursively
Calculate x^n recursively
Newton-Raphson method
Array manipulation and matrix operations
Display 2D array elements
Find maximum value
Find both min and max
Search in sorted array - O(log n) time complexity
Calculate array average
Sort using bubble sort - O(n²) time complexity
Sort using merge sort - O(n log n) time complexity
Sort using selection sort - O(n²) time complexity
Sort using insertion sort - O(n²) time complexity
Sort from high to low
Sort from low to high
Remove duplicates
Combine two arrays
Remove specific element
Find intersection
Array copy
Rotate array elements
Sort each row of 2D array
Compare two matrices
Transpose a matrix
Calculate determinant
Calculate normal and trace
Matrix addition
Matrix multiplication
Print border elements
Sum diagonal elements
Simple search algorithm
Calculate sum of all elements
Find second maximum in array
String manipulation programs
Join two strings
Binary string addition
Find first unique character
Check palindrome string
Reverse string characters
Recursive string reverse
Find length without strlen
Sort string alphabetically
Check if contains all alphabets
Extract initials
Get character code
Strip leading zeros
Compare strings
Dictionary order comparison
Insert substring
Split by delimiter
Type and number system conversions
Convert bool to string
Convert float to string
Convert double to string
Convert string to long
Convert long to string
Convert integer to character
Convert character to integer
Convert octal to decimal
Convert decimal to octal
Convert hex to decimal
Convert decimal to hex
Convert decimal to binary
Convert binary to decimal
Pointer-based programs
Function returning pointer
2D pointer array declaration
Array max with pointers
Swap using pointers
Pointer-based sorting
Sort string array
Palindrome with pointers
Copy linked list recursively
Learn address-of (&) and dereference (*) operators
Traverse array with pointer arithmetic
Count vowels, reverse using pointers
Understanding and using double pointers
Allocate and resize arrays dynamically
Store and call functions via pointers
Implement callbacks in C
Linked list data structures
Basic linked list creation and traversal
Insert at beginning, end, and position
Delete by value and position
Reverse singly linked list
Linear search in linked list
Create and manipulate doubly linked list
Implement circular linked list
Count nodes in linked list
User-defined data types
Student data structure
Sort structures by name
Distance calculation
Complex number addition
Sort by numeric field
Structure file I/O
Dynamic struct arrays
File handling programs
Temporary file creation
Structure file operations
File renaming
Set file permissions
File comparison
File copy operation
Pattern search in file
File append operation
File transfer
Zip file reading
Date and time programs
AM/PM time formatting
Display running clock
Date formatting
Show system date/time
Time puzzle problem
Timezone conversion
Time unit conversion
Miscellaneous useful programs
Runtime error examples
Different error types
Division operations
Extract name initials
Graphics programming
Quine program
These examples are great for practice. For comprehensive explanations of C concepts, explore our structured tutorials.
Browse All Tutorials