C Programming Examples

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

All the C programming examples that are present on this page might contain at least three examples, which include programs using For Loop, using While Loop, methods. In some cases, Recursions.

Simple C Programming Examples

The following C programming examples are the basic and simple programs. And the best way to learn them is by practicing all of the examples. We suggest you understand the logic iteration-wise. So that, you can write your own logic for future examples.

Please visit our C Language section to learn the Programming languages with examples.

  1. C Program to Print Hello World
  2. C Program to Add Two Numbers
  3. C Program To Find the Average of Two Numbers
  4. C Program to Find the Absolute Value of a Number
  5. C Program to Find the Compound Interest
  6. C program to Calculate the Cube of a Number
  7. C Program to check Number is Even or Odd
  8. C Program to Print Even Numbers from 1 to N
  9. C Program to Find Largest of Two Numbers
  10. C Program to Find Largest of Three Numbers
  11. C Program to Print Multiplication Table
  12. C Program to Find the Number is Divisible by 5 and 11
  13. C Program for nCr Calculation
  14. C Program for nPr Calculation
  15. C Program to Print Odd Numbers from 1 to N
  16. C program to Calculate the Power of a Number
  17. C program to Find Profit or Loss
  18. C Program to Print an Integer, Character, and Float Value
  19. C Program to find the size of int, float, double, and char
  20. C Program to check Positive or Negative Numbers
  21. C Program to Print 1 to 100 without using Loop
  22. C Program to Find the Roots of a Quadratic Equation
  23. C Program to Calculate the Simple Interest
  24. C Program to Calculate Standard Deviation
  25. C Program to Find the Sum of Even and Odd numbers in a Given Range
  26. C Program to Find the Sum and Average of Three Numbers
  27. C Program to Find the Square of a Number
  28. C Program to Find the Square root of a Number
  29. C Program to Print First 10 Even Natural Numbers
  30. C Program to Print First 10 Natural Numbers
  31. C Program to Print First 10 Natural Numbers in Reverse
  32. C Program to Print First 10 Odd Natural Numbers
  33. C Program to Read 10 Numbers and Find their Sum and Average
  34. C Program to Find Sum of 10 Numbers and Skip Negative Numbers
  35. C Program to Find Sum of 10 Numbers until user enters positive number
  36. C Program to Find the Sum of Even Numbers from 1 to n
  37. C Program to Find the Sum of Odd Numbers from 1 to n
  38. C Program to Find the Student Grade
  39. C Program to Find the Total, Average, and Percentage of Five Subjects
  40. C Program to Multiply Two Floating Point Numbers
  41. C Program to Find the Quotient and Remainder
  42. C Program to accept User Input and Print
  43. C Program to Perform the Arithmetic Operations using Functions
  44. C Program to Find the Range of Data Types
  45. C Program to Find the Distance Between Two Points

C Advanced Number Programs

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

  1. C Program to Check the 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 Bill
  5. C Program to find Factors of a Number
  6. C Program to Find the Factorial of a Given Number
  7. C Program to Find the First Digit of Number
  8. C Program to Print the 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 the Gross Salary of an Employee
  12. C Program to Print the Last Digit of Number
  13. C Program to Calculate LCM of Two Numbers
  14. C Program to Find theNCR 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 Krishnamurthy Number
  18. C Program to Check Neon Number
  19. C Program to Check Palindrome Number
  20. C Program to Check Perfect Number or Not
  21. C Program to Check Prime Number
  22. C Program to Print Prime Numbers from 1 to 100
  23. C Program to Calculate Product of Digits of a Number
  24. C Program to Find the Prime Factors of a Number
  25. C Program to Reverse a Number
  26. C program to Reverse a Number using Recursive Function
  27. C Program to Swap Two Numbers
  28. C Program to Find the Sum of First and Last Digit of a Number
  29. C Program to Swap First and Last Digit of a Number
  30. C Program to Find the Sum of N Natural Numbers
  31. C Program to Find the Sum and Average of N Numbers
  32. C Program to Check Strong Number
  33. C Program to Find the Sum of Digits in a Given Number
  34. C Program to Create a Simple Calculator
  35. C Program to Find the Total Notes in a Given Amount
  36. C Program to Print Floyds Triangle
  37. C Program to Print Pascal Triangle

Programs on Calendar

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

C Programs on Conversions

The following are the list of programs to Convert

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

Programs on Characters

Below programs are the Programs to Check whether the Character is

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

C String Programs

The list of programs on strings or character arrays.

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

C Programming Examples on Area

The following are the list of programs on Area.

  1. 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
  19. C Program to Find the Area of a Semicircle
  20. C Program to Find the Perimeter of a Square

Volume and Surface Area Programs

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

C Programs on Arrays

The following are the list of most common Array programs.

  1. C Program to Perform Arithmetic Operations on One Dimensional Array
  2. C Program to find the Number of Elements in an Array
  3. C Program to Count Even and Odd Numbers in an Array
  4. C Program to Count Positive and Negative Numbers in an Array
  5. C Program to Copy an Array to another
  6. C Program to Find the Average of an Array
  7. C Program to Count Occurrence of an Element in an Array
  8. C Program to Count Frequency of each Element in an Array
  9. C Program to Count Total Number of Duplicate Elements in an Array
  10. C Program to Delete an Element in an Array
  11. C Program to Delete Duplicate Elements from an Array
  12. C Program to Insert an Element into an Array
  13. C Program to Find the Largest Number in an Array
  14. C Program to Find the Largest and Smallest Number in an Array
  15. C Program to Find the Length or Size of an Array
  16. C Program to Merge Two Arrays
  17. C Program to Print Elements in an Array
  18. C Program to Put Even and Odd Numbers in two Separate Arrays
  19. C Program to Put Positive and Negative Numbers in two Separate Arrays
  20. C Program to Print Negative Numbers in an Array
  21. C Program to Print Positive Numbers in an Array
  22. C Program to Reverse an Array
  23. C Program to Search for Element in an Array
  24. C Program to Find the Second largest Number in an Array
  25. C Program to Find the Smallest Number in an Array
  26. C Program to Find the Second Smallest Element in an Array
  27. C Program to Sort Array in Ascending Order
  28. C Program to Sort Array in Descending Order
  29. C Program to Find the Sum of all Elements in an Array
  30. C Program to Find the Sum of Even and Odd Numbers in an Array
  31. C Program to Swap Two Arrays Without Using Temp Variable
  32. C Program to Find the Unique Elements in an Array
  33. C Program to Increment All Elements of an Array by One
  34. C Program to Print the Kth Element in an Array
  35. C Program to Left Rotate Array Items
  36. C Program to Right Rotate Array Elements
  37. C Program to Find Array Elements Greater than Average
  38. C Program to Print 2D Array Elements

C Programs on Matrix

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

C Programs – Sort Examples

  1. C Program for Bubble Sort
  2. C Program for Quick Sort
  3. C Program for Insertion Sort
  4. C Program for Selection Sort

Program on Pointers

  1. C Program to Add Two Numbers using Pointers
  2. C Program to Create, Initialize, and Access a Pointer Variable
  3. C Program to Count Vowels and Consonants in a String using a Pointer
  4. C Program to Find the Largest of Two Numbers using a Pointer
  5. C Program to Find the Largest of Three Numbers using a Pointer
  6. C Program to Pass Pointers as the Function Arguments
  7. C Program to Print String using Pointer
  8. C Program to Read and Print Array Elements using a Pointer
  9. C Program to Sort an Array using a Pointer
  10. C Program to Find the Sum and Average of Array Elements using a Pointer
  11. C Program to Swap Two Numbers using Pointer

C Programs to print Series

  1. C Program to Find the Fibonacci Series, Nth Number and the Sum of it
  2. C Program to Find the Sum of series 1²+2²+3²+….+n²
  3. C Program to Find the Sum of series 1³+2³+3³+….+n³
  4. C Program to Find the Sum of Geometric Progression Series
  5. C Program to Find the Sum of Arithmetic Progression Series

Display Patterns and Shapes

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

  1. C Star Pattern Programs
  2. C Number Pattern Programs
  3. C Alphabet Pattern Programs

Comments are closed.