C Programs

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.





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



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++


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



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



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++


1. Menu Driven C Program to Perform Insert, Display and Delete Operations on a Singly Linked List (SLL)
2. C Program for Array Representation of Stack [Push, Pop and Display]
3. C Program to Create a Binary Tree Using Recursion [Linked Representation]
4. C Program for Sorting an Array using Heap Sort
5. C Program for Tower of Hanoi Problem
6. What is Quick Sort? Algorithm and C Program to Implement Quick Sort
7. C Program for Finding Transpose of a Sparse Matrix
8. C Program and Algorithm for Evaluation of a Postfix Expression
9. C Program and Algorithm for Conversion of an Expression from Infix to Postfix
10. C Program for Various Operations on a Dequeue (Double Ended Queue) Represented Using a Circular Array
11. C Program for Addition of two Sparse Matrices
12. C Program for AVL Tree Implementation
13. C Program for Implementation of Merge Sort
14. Representation of Graphs: Adjacency Matrix and Adjacency List
15. Depth First Search (DFS) Traversal of a Graph [Algorithm and Program]
16. What are B-Trees?
17. C Program for Addition and Multiplication of Polynomial Using Arrays or Linked List
18. C Program for Implementation of Circular Queue Using Array
19. Kruskal’s Algorithm for Finding Minimum Cost Spanning Tree
20. What are B+ Trees?
21. Prim’s Algorithm and Program for Finding Minimum Cost Spanning Tree of a Graph
22. C Program to Reverse a Linked List
23. C/C++ Program and Algorithm for Selection Sort
24. C/C++ Program and Algorithm for Insertion Sort
25. C Program for N Queens Problem Using Backtracking
26.  C Program for Binary Search Tree Insertion and Preorder Traversal
27. Counting Sort Program in C
28. C/C++ Program for Priority Scheduling Algorithm
29. C/C++ Program for First Come First Served (FCFS) Scheduling Algorithm
30. C Program for Shortest Job First (SJF) Scheduling Algorithm
31. C Program for Longest Common Subsequence Problem
32. Breadth First Search (BFS) Program in C
33. Doubly Linked List in C and C++
34. Round Robin Scheduling Program in C
35. Dijkstra’s Algorithm in C [Program & Algorithm]
36. Radix Sort Program in C
37. Circular Linked List in C
38. Banker’s Algorithm in C
39. Producer Consumer Problem in C
40. LRU Page Replacement Algorithm in C
41. Optimal Page Replacement Algorithm in C