C Programming Examples

This page contains the list of C programming examples which covers the concepts like basic c programs, programs on numbers, loop programs, functions, recursions etc.

All the C programming examples that are present in this page might contain at least three examples, which includes program using For Loop, using While Loop, Functions. In some case, Recursions.

Simple C Programming Examples

The following C programming examples are the basic and simple programs.

Please visit our C Language section to learn C Programming with examples

  1. C Program to Print Hello World
  2. C Program to Add Two Numbers
  3. C Program for Average of Two Numbers
  4. C program to find Compound Interest
  5. C program to Calculate Cube of a Number
  6. C Program to check Number is Even or Odd
  7. C Program to Print Even Numbers from 1 to N
  8. C Program to find Largest of Two Numbers
  9. C Program to find Largest of Three Numbers
  10. C Program to print Multiplication Table
  11. C program to find Number is Divisible by 5 and 11
  12. C Program for nCr Calculation
  13. C Program for nPr Calculation
  14. C Program to print Odd Numbers from 1 to N
  15. C program to calculate Power of a Number
  16. C program to find Profit or Loss
  17. Print an Integer, Character, and Float Value
  18. Positive or Negative Number
  19. Print 1 to 100 without using Loop
  20. Roots of a Quadratic Equation
  21. Simple Interest
  22. Standard Deviation
  23. Sum of Even and Odd numbers in a Given Range
  24. Square of a Number
  25. Square root of a Number
  26. Sum of Even Numbers from 1 to n
  27. Sum of Odd Numbers from 1 to n
  28. Student Grade
  29. Total, Average, and Percentage of Five Subjects
  30. C example to accept User Input and Print

C Programming Examples on Numbers

The list of advanced Number programs in C Programming language with multiple examples.

  1. C Program to check the Number is Armstrong Number
  2. C program to Count Number of Digits in a Number
  3. C program to Check Number is a Prime, Armstrong, or Perfect Number
  4. C program to Calculate Electricity BillC
  5. C Program to find Factors of a Number
  6. C Program to find Factorial of a Given Number
  7. C program to print First Digit of Number
  8. C program to print First and Last Digit of a Number
  9. C program to calculate GCD of Two Numbers
  10. C program to calculate Generic Root of a Number
  11. C program to find Gross Salary of an Employee
  12. C program to print Last Digit of Number
  13. C program to calculate LCM of Two Numbers
  14. C program to find NCR Factorial of a Number
  15. C program to print Natural Numbers from 1 to N
  16. C program to print Natural Numbers in Reverse Order
  17. C program to Check Palindrome or Not
  18. C program to check Perfect Number or Not
  19. C program to check Prime Number
  20. C program to print Prime Numbers from 1 to 100
  21. C program, to calculate Product of Digits of a Number
  22. C program to find Prime Factors of a Number
  23. C example to Reverse a Number
  24. C example to Swap Two Numbers
  25. C example to fid Sum of First and Last Digit of a Number
  26. C example to Swap First and Last Digit of a Number
  27. C example to find Sum of N Natural Numbers
  28. C example to calculate Sum and Average of N Numbers
  29. C program to check Strong Number
  30. C program to find Sum of Digits in a Given Number
  31. C program for Simple Calculator
  32. Total Notes in a Given Amount

Calendar Programs in C

  1. C Program to find the Leap Year
  2. C example to find the Day Name of a Week
  3. Days to Years Weeks and Days
  4. Number of Days in a Month

Conversion Programs in C

The following are the list of C programs to Convert

  1. C Program to Convert Binary to Decimal
  2. C example to Convert Centimeter to Meter and Kilometer
  3. Celsius to Fahrenheit
  4. Decimal to Binary Number
  5. Decimal to Octal Number
  6. Fahrenheit to Celsius
  7. Kilometer to Meter Centimeter and Millimeter

C Programs on Characters

Below programs are the C Programs to Check whether the Character is

  1. C Program to find the ASCII Value of Single Character
  2. C example to find ASCII Values of all Characters
  3. Alphabet or Not
  4. Alphabet or Digit
  5. Convert Character to Uppercase
  6. Convert Character to Lowercase
  7. Digit or Not
  8. Digit or Alphabet or Special Character
  9. Lowercase or Not
  10. Lowercase or Uppercase Alphabet
  11. Print Alphabets from a to z
  12. Print Alphabets between A and Z
  13. Uppercase or Not
  14. Vowel or Consonant

C Programming Examples on String

  1. C Program to find the ASCII Value of Total Characters in a String
  2. C example to find All Occurrence of a Character in a String
  3. C programming example to find Characters in a String
  4. Compare two Strings
  5. Concatenate Two Strings
  6. Copy String
  7. Count Alphabets, Digits and Special Characters in a String
  8. Count Vowels, and Consonants in a String
  9. Counting All Occurrence of a Character in a String
  10. Count Total Number of Words in a String
  11. Frequency of each Character in a String
  12. First Occurrence of a Character in a String
  13. First Occurrence of a Word in a String
  14. Last Occurrence of a Character in a String
  15. Length of a String
  16. Lowercase to Uppercase
  17. Maximum Occurring Character in a string
  18. Minimum Occurring Character in a String
  19. Palindrome String
  20. Remove First Occurrence of a Character in a String
  21. Remove Last Occurrence of a Character in a String
  22. Removing All Occurrences of a Character in a String
  23. Remove All Duplicate Characters in a String
  24. Replace First Occurrence of a Character in a String
  25. Replace Last Occurrence of a Character in a String
  26. Replacing All Occurrence of a Character in a String
  27. Reverse a String
  28. Reverse Order of Words in a String
  29. Toggle Case of all Characters in a String
  30. Uppercase to Lowercase

C Programming Examples on Area

The following are the list of Area programs in C language

  1. C Program to Find the Area of a Circle
  2. Diameter, Circumference, and Area of a Circle
  3. Area of a Triangle
  4. Area of a Triangle using Base and Height
  5. Angle of a Triangle if two angles are given
  6. Triangle is Equilateral Isosceles or Scalene
  7. Use Angles to check Triangle is valid or Not
  8. Use Sides to check Triangle is Valid or Not
  9. Area of an Isosceles Triangle
  10. Area of Rectangle
  11. Area of a Rectangle using Length and Width
  12. Perimeter of a Rectangle using Length and Width
  13. Area of a Parallelogram
  14. Area of a Trapezoid
  15. Area of a Right Angled Triangle
  16. Find Area of an Equilateral Triangle
  17. Area of a Rhombus
  18. Perimeter of a Rhombus

Volume and Surface Area Programs in C

Following are the list of Volume and Surface Area programs

  1. Volume and Surface Area of Sphere
  2. Volume and Surface Area of a Cylinder
  3. Find Volume and Surface Area of a Cube
  4. Volume and Surface Area of a Cuboid
  5. Volume and Surface Area of a Cone

Array Programs in C

The following are the c programming examples on Arrays

  1. C Program to Perform Arithmetic Operations on One Dimensional Array
  2. C example to Count Even and Odd Numbers in an Array
  3. C example Count Positive and Negative Numbers in an Array
  4. C example to Copy an Array to another
  5. Count Frequency of each Element in an Array
  6. Count Total Number of Duplicate Elements in an Array
  7. Delete an Element in an Array
  8. Delete Duplicate Elements from an Array
  9. Insert an Element into an Array
  10. Largest Number in an Array
  11. Largest and Smallest Number in an Array
  12. Length or Size of an Array
  13. Merge Two Arrays
  14. Print Elements in an Array
  15. Put Even and Odd Numbers in two Separate Arrays
  16. Put Positive and Negative Numbers in two Separate Arrays
  17. Print Negative Numbers in an Array
  18. Print Positive Numbers in an Array
  19. Reverse an Array
  20. Search for Element in an Array
  21. Second largest Number in an Array
  22. Smallest Number in an Array
  23. Sort Array in Ascending Order
  24. Sort Array in Descending Order
  25. Sum of all Elements in an Array
  26. Sum of Even and Odd Numbers in an Array
  27. Swap Two Arrays Without Using Temp Variable
  28. Unique Elements in an Array

Matrix Programs

  1. C Program to Perform Arithmetic Operations on Multi-Dimensional Arrays
  2. C example to add two Matrices
  3. C example to Check Two Matrices are Equal or Not
  4. C example to Determinant of a Matrix
  5. Identity Matrix
  6. Interchange Diagonals of a Matrix
  7. Lower Triangle Matrix
  8. Scalar Multiplication of a Matrix
  9. Sparse Matrix
  10. Sum of Diagonal Elements in a Matrix
  11. Sum of each and every Row and Column in a Matrix
  12. Summing each row in a Matrix
  13. Sum of each column in a Matrix
  14. Subtract Two Matrices
  15. Sum of Lower Triangle Matrix
  16. Sum of Opposite Diagonal Elements in a Matrix
  17. Symmetric Matrix
  18. Sum of Upper Triangle Matrix
  19. Transpose a Matrix
  20. Upper Triangle Matrix

C Sort Examples

  1. Bubble Sort
  2. Quick Sort
  3. Insertion Sort
  4. Selection Sort

Pointers Programs

  1. Add Two Numbers using Pointers
  2. Pass Pointers as the Function Arguments

C Programs to print Series

  1. Fibonacci Series Program
  2. Find Nth Fibonacci Number
  3. Sum of series 1²+2²+3²+….+n²
  4. Sum of series 1³+2³+3³+….+n³
  5. Find Sum of Geometric Progression Series
  6. Sum of Arithmetic Progression Series

C Programs to display Patterns and Shapes

The following are the list of C programs to Print patterns and shapes

  1. C Example to print exponentially Increasing Star Pattern
  2. C example to Print Floyd’s Triangle
  3. C example to Print Diamond Star Pattern
  4. C example to Print Half Diamond Star Pattern
  5. C example to Print Mirrored Half Diamond Star Pattern
  6. C example to Print Left Arrow Star Pattern
  7. C example to Print Pascal Triangle
  8. C example to Print Pyramid Star Pattern
  9. C example to Print Hollow Pyramid Star
  10. C example to Print Inverted Pyramid Star Pattern
  11. C example to Print Hollow Inverted Star Pyramid
  12. Plus Star Pattern
  13. Rectangle Star Pattern
  14. Hollow Rectangle Star Pattern
  15. Right Arrow Star Pattern
  16. Right Angled Triangle Star Pattern
  17. Hollow Right Triangle Star Pattern
  18. Reversed Mirrored Right Triangle
  19. Mirrored Right Triangle Star Pattern
  20. Hollow Mirrored Right Triangle Star Pattern
  21. Inverted Right Triangle Star Pattern
  22. Hollow Inverted Right Triangle Star Pattern
  23. Inverted Mirrored Right Triangle Star Pattern
  24. Hollow Inverted Mirrored Right Triangle Star Pattern
  25. Rhombus Star Pattern
  26. Hollow Rhombus Star Pattern
  27. Mirrored Rhombus Star Pattern
  28. Hollow Mirrored Rhombus Star Pattern
  29. Square Star Pattern
  30. Hollow Square Star Pattern
  31. Hollow Square Pattern With Diagonals
  32. X Star Pattern

C Programming Examples on Number pattern

The following are the remaining number pattern C programming examples.

  1. C program to Print Box Number Pattern of 1 and 0
  2. C example to Print Hollow Box Number Pattern
  3. C example to Print Inverted Right Triangle Number Pattern
  4. C example to Print 1 and 0 in Alternative Rows
  5. C program to print 1 and 0 in Alternative Columns
  6. C example to Print Right Triangle Number Pattern
  7. C Program to Print Numeric Right Triangle Pattern 2
  8. C Program to Print Numeric Right Triangle Pattern 3
  9. C Program to Print Right Triangle of Incremented Numbers
  10. C program to print Right Triangle of Numbers in Decreasing order
  11. C Program to print Square Number Pattern
  12. C Program to Print a Square where each row contains one Number
  13. C Program to Print a Square where each column contains one Number
  14. C Program to Print Same Numbers in Rows and Columns

Comments are closed.