Here is the collection of C program examples. These C programming examples will help you to learn various concepts like array, pointer, string, data structure and algorithm, etc.

### Simple

### Loops

### If/Else

1. C program to find greatest number among three numbers

2. C program to find out whether a given year is a leap year or not

3. C program to find whether a given character is an alphabet,digit or any special character(using ASCII values)

4. C program to convert temperature from Fahrenheit to Celsius or Celsius to Fahrenheit

5. C program to check whether a given number is even or odd

6. C program to swap two numbers without using temporary variable

7. C program to calculate roots of quadratic equation ax^2+bx+c=0

### Array

1. C program to multiply two matrices

2. C program to read a matrix of size mxn and display it on the screen

3. C program to find sum of elements above and below the main digonal of a matrix

4. C program to insert an element in an array

5. C program to find the sum of digonals of a square matrix

6. C program to sort an Array by using Bubble sort

7. C program to add two matrices

8. C program to find largest and smallest element from a 1D array

9. C program to read a matrix of size mxn and print its transpose

10. C program to search an element in a 1D array [linear search]

11. C/C++ Program for Union of Two Arrays

12. Program for Shell Sort in C and C++

13. Find Inverse of a Matrix

### Sum Of Series

### Switch Case

1. C program to input number of week’s day(1-7) and translate to its equivalent name of the day of the week

2. C program to perform arithmetic operations using switch case

3. C program to check given alphabate is vowel or not using switch case

### Pointer

1. C program to read and display an array using pointer

2. C program to swap two numbers using pointers

3. C/C++ Program to Read Infinite Numbers and Arrange Them in Ascending Order

### File Handling

1. C program to read data from keyboard and write it to a text file

2. C program to copy the contents of one file into another

3. C program to write student record to a binary file

4. C program to read integer numbers from a file named DATA and then write all odd numbers to a file named ODD and all even numbers to a file named EVEN

5. C program that reads a file containing integers and appends at its end the sum of all the integers

### String

1. C program to read a string and print it in alphabetical order

2. C program to find length of a string

3. C program to reverse a string

4. C program to check whether given string is palindrome or not

5. C program to count number of words in a string

6. C program which reads a text and count all occurrences of a particular word

7. C program which reads your name from the keyboard and outputs a list of ASCII codes which represent your name

8. C program to concatenate two strings without using strncat() function

9. C/C++ Program to Find Substring in String (Pattern Matching)

10. C Program to Check two Strings are Anagrams or not

11. C/C++ Program to Remove Spaces From String

12. Permutation of String in C and C++

### Structure

1. C program to add two numbers using structure

2. C program that compare two given dates. To store a date use a structure that contains three members namely day, month and year. If dates are equal then display a message as EQUAL otherwise UNEQUAL

### Functions

1. C program to find factorial of any number using recursion

2. C/C++ Program for Fibonacci Series Using Recursion

3. C/C++ Program to Find GCD of Two Numbers Using Recursion

**Searching & Sorting**

**Data Structure & Algorithm**

- Singly Linked List
- Stack [Push, Pop and Display]
- Binary Tree Using Recursion
- Tower of Hanoi Problem
- Transpose of a Sparse Matrix
- Evaluation Postfix Expression
- Infix to Postfix Conversion
- Dequeue (Double Ended Queue)
- Addition of two Sparse Matrices
- AVL Tree
- Depth First Search (DFS) Traversal
- Addition and Multiplication of Polynomial Using Arrays or Linked List
- Circular Queue Using Array
- Kruskal’s Algorithm
- Prim’s Algorithm
- Reverse a Linked List
- N Queens Problem Using Backtracking
- Binary Search Tree Insertion and Preorder Traversal
- Longest Common Subsequence Problem
- Breadth First Search (BFS)
- Doubly Linked List
- Dijkstra’s Algorithm
- Circular Linked List
- Checksum Algorithm
- Caesar Cipher
- Hill Cipher
- Hamming Code
- RSA Algorithm
- Bisection Method
- Sliding Window Protocol

**Operating System**

- Priority Scheduling Algorithm
- First Come First Served (FCFS) Scheduling Algorithm
- Shortest Job First (SJF) Scheduling Algorithm
- Round Robin Scheduling
- Banker’s Algorithm
- Producer Consumer Problem
- LRU Page Replacement Algorithm
- Optimal Page Replacement Algorithm
- Best Fit Algorithm
- First Fit Algorithm
- Lexical Analyzer

**Computer Graphics**