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.

C Programs

Simple

 

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 find sum of elements above and below the main digonal of a matrix
3. C program to insert an element in an array
4. C program to find the sum of digonals of a square matrix
5. C program to sort an Array by using Bubble sort
6. C program to add two matrices
7. C program to find largest and smallest element from a 1D array
8. C program to read a matrix of size mxn and print its transpose
9. C program to search an element in a 1D array [linear search]
10. C/C++ Program for Union of Two Arrays
11. Program for Shell Sort in C and C++
12. 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. Singly Linked List
  2. Stack [Push, Pop and Display]
  3. Binary Tree Using Recursion
  4. Tower of Hanoi Problem
  5. Transpose of a Sparse Matrix
  6. Evaluation Postfix Expression
  7. Infix to Postfix Conversion
  8. Dequeue (Double Ended Queue)
  9. Addition of two Sparse Matrices
  10. AVL Tree
  11. Depth First Search (DFS) Traversal
  12. Addition and Multiplication of Polynomial Using Arrays or Linked List
  13. Circular Queue Using Array
  14. Kruskal’s Algorithm
  15. Prim’s Algorithm
  16. Reverse a Linked List
  17. N Queens Problem Using Backtracking
  18. Binary Search Tree Insertion and Preorder Traversal
  19. Longest Common Subsequence Problem
  20. Breadth First Search (BFS)
  21. Doubly Linked List
  22. Dijkstra’s Algorithm
  23. Circular Linked List
  24. Checksum Algorithm
  25. Caesar Cipher
  26. Hill Cipher
  27. Vigenere Cipher
  28. Hamming Code
  29. RSA Algorithm
  30. Bisection Method
  31. Sliding Window Protocol
  32. Travelling Salesman Problem
  33. Matrix Chain Multiplication
  34. Bellman-Ford Algorithm
  35. Priority Queue
  36. Rail Fence Cipher
  37. Data Encryption Standard (DES) Algorithm

Operating System

  1. Priority Scheduling Algorithm
  2. First Come First Served (FCFS) Scheduling Algorithm
  3. Shortest Job First (SJF) Scheduling Algorithm
  4. Round Robin Scheduling
  5. Banker’s Algorithm
  6. Producer Consumer Problem
  7. LRU Page Replacement Algorithm
  8. Optimal Page Replacement Algorithm
  9. Best Fit Algorithm
  10. First Fit Algorithm
  11. Lexical Analyzer
  12. Dining Philosophers Problem

Computer Graphics

  1. Midpoint Circle Algorithm
  2. Bresenham’s Line Drawing Algorithm
  3. DDA Line Drawing Algorithm
  4. Flood Fill Algorithm
  5. Boundary Fill Algorithm
  6. Liang Barsky Line Clipping Algorithm
  7. Cohen Sutherland Line Clipping Algorithm