The best way to learn C programming is by practicing lots of example programs. The benefit of practicing examples, besides learning concepts is improved problem-solving skills and coding skills. Some programs in the list given below include flowchart to help you understand the program logic. We highly recommend trying these examples on your own, before comparing the solutions.
Prerequisites
The prerequisites to learn and practice these examples listed below.
- C Tutorial – learn C programming language before you practice example programs.
- C Compiler – you will need a C compiler to run these example programs. Learn how to install Turbo C++ 3.0 compiler.
- Pen and Paper – Some programs especially math related programs require you to verify the output manually.
C Examples
Here is a list of example C programs.
C Math Examples
- Reverse a Number Using Recursion
- Sum Of First N Natural Numbers
- A Simple Calculator
- Swap Numbers Without Third Variable
- Remainder Without Mod Operation
- Standard Deviation
- Find Remainder And Quotient
- Find Average Age
- Find GCD of Two Numbers
- Find Nth Factorial Using Recursion
- Check If a Number Is Prime Or Not
- Compute Nth Fibonacci Number
- Check For Armstrong Number
- Find Permutation And Combination
- Program to Manipulate Matrices
- Gauss Elimination Method
- Find Determinant Of a 3 x 3 Matrix
- Find Area Of a Triangle
- Generate Random Numbers
- Find Sum Of Geometric Progression
- Identify a Quadrilateral
- Law of Sine Problems
- Compute Cosine Series
C String Examples
- Reverse a Given String
- Count Frequency Of Vowels
- Program To Print Floyd Triangle
- Check a Palindrome String
- Write a String Copy Function
- Output Current Date And Time
- Display Student Results
- Binary Number To 2’s Complement
- Process Marks And Display Grades
- Program To Write a File
- Program To Find Memory Size Of Arrays
C Graphics Examples
- C Program to Draw a Line
- C Program to Draw a Rectangle.
- C Program to Draw Bar Chart.
- C Program to Draw Bar Diagram With Data.
- C Program to Display a 3D Bar Chart.
- C Program to Draw a Circle
- C Program to Draw a Polygon Shape
- C Program to Draw and Fill Color in Polygon.
C Data Structure Examples
- Implement Stack Using Linked-List
- Implement a Stack Data Structure
- Solve Tower Of Hanoi Using Recursion
C Algorithms
- Find Biggest And Smallest Number
- Linear Search And Binary Search
- Find MAX and MIN Using Pointers
- Implement the Insertion Sort Algorithm
- Implement the Bubble Sort Algorithm