C Programs with Output

On this page, you'll find a list of 100+ C programs for interview preparation and practice. Each program is discussed in individual blog posts.  All the C programs are explained with output and step-by-step explanations.

C programming is a high-level programming language developed by Dennis Ritchie in the early 1970s. Originally designed for implementing the UNIX operating system, it has since become a widely used language for various types of software development.

C programming is known for its performance, portability, and direct access to hardware, offering a level of control often not found in higher-level languages. C is especially important for understanding the inner workings of computers and serves as a foundation for many other programming languages, including C++, C#, and Objective-C.

C Programs with Output

C Program Hello World Program Explained
C Program to Add Two Numbers
C Program to Subtract Two Numbers
C Program to Multiply Two Numbers
C Program to Divide Two Numbers
C Program to Find the Remainder of Two Numbers
C Program to Calculate Factorial using Recursion
C Program to Generate Fibonacci Series
C Program to Check Prime Number
C Program to Find Largest among Three Numbers
C Program to Swap Two Numbers
C Program to Reverse a Number
C Program to Calculate the Power of a Number
C Program to Find ASCII Value of a Character
C Program to Check Even or Odd Number
C Program to Check Leap Year
C Program to Find Largest of Two Numbers using Ternary Operator
C Program to Convert Celsius to Fahrenheit
C Program to Convert Fahrenheit to Celsius
C Program to Calculate Simple Interest
C Program to Calculate Compound Interest
C Program to Find Length of String without using Library Function
C Program to Concatenate Two Strings without Using Library Function
C Program to Compare Two Strings without using Library Function
C Program to Copy Strings without using the Library Function
C Program to Check Palindrome String
C Program to Reverse a String
C Program to Sort Array in Ascending Order
C Program to Sort Array in Descending Order
C Program to Merge Two Arrays
C Program to Find Maximum Element in Array
C Program to Insert an Element in an Array
C Program to Delete an Element from Array
C Program to Search an Element in an Array
C Program to Count Total Number of Duplicate Elements in an Array
C Program to Find Transpose of a Matrix
C Program to Multiply Two Matrices
C Program to Check Matrix Symmetry
C Program to Find Sum of Natural Numbers using Recursion
C Program to Check Armstrong Number
C Program to Generate Random Numbers
C Program to Check Whether a Number is Palindrome or Not
C Program to Check Whether a Number is Negative or Positive
C Program to Find Sum of Digits of a Number
C Program to Count Number of Digits in an Integer
C Program to Calculate Average Using Arrays
C Program to Print Multiplication Table of Given Number
C Program to Find GCD of Two Numbers
C Program to Find LCM of Two Numbers
C Program to Print Stars in Pyramid Shape
C Program to Check Whether a Character is a Vowel or Consonant
C Program to Count Substrings in a String
C Program to Count Frequency of Each Character in String
C Program to Find Sum of Array Elements using Pointers
C Program to Swap Two Numbers Using Pointers
C Program to Concatenate Two Strings Using Pointers
C Program to Compare Two Strings Using Pointers
C Program to Copy One String to Another Using Pointers
C Program to Find Length of a String Using Pointers
C Program to Reverse a String Using Pointers
C Program to Access Two-Dimensional Array Using Pointers
C Program to Add Two Matrices Using Multi-dimensional Arrays
C Program to Compute Matrix Multiplication Using Multi-dimensional Arrays
C Program to Store Information of a Student Using Structure
C Program to Calculate Difference Between Two Time Periods
C Program to Store and Display Information Using Structures with Pointers
C Program to Calculate Area of Rectangle Using Functions
C Program to Find Roots of a Quadratic Equation Using Functions
C Program to Create Simple Calculator Using Switch Case
C Program to Find LCM and GCD Using Recursion
C Program to Find Factorial of a Number Using Recursion

C Programs on Data Structures and Algorithms

C Program to Implement a Single-Dimensional Array
C Program to Search an Element in an Array Using Linear Search
C Program to Search an Element in an Array Using Binary Search
C Program to Implement Singly Linked List
C Program to Implement Doubly Linked List
C Program to Reverse a Singly Linked List
C Program to Implement Stack Using Arrays
C Program to Implement Queue Using Arrays
C Program to Implement Stack Using Linked List
C Program to Implement Queue Using Linked List
C Program to Implement Binary Search Tree
C Program to Perform Inorder, Preorder, and Postorder Traversal of a Binary Tree
C Program to Implement AVL Tree
C Program to Implement Graph Using Adjacency Matrix
C Program to Implement Graph Using Adjacency List
C Program to Implement Bubble Sort
C Program to Implement Insertion Sort
C Program to Implement Merge Sort
C Program to Implement Quick Sort
C Program to Implement Linear Search
C Program to Implement Binary Search
C Program to Implement Dijkstra’s Algorithm
C Program to Implement Floyd-Warshall Algorithm
C Program: Bubble Sort in Ascending Order
C Program: Bubble Sort in Descending Order
C Program: Selection Sort in Ascending Order
C Program: Selection Sort in Descending Order
C Program: Insertion Sort in Ascending Order
C Program: Insertion Sort in Descending Order
C Program: Merge Sort in Ascending Order
C Program: Merge Sort in Descending Order
C Program: Quick Sort in Ascending Order
C Program: Quick Sort in Descending Order
C Program: Heap Sort in Ascending Order
C Program: Heap Sort in Descending Order

Comments