Tutorial Gateway

  • C
  • C#
  • Java
  • Python
  • SQL
  • MySQL
  • Js
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs

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.

TIP: Please visit our C Programming section to learn C Programming with examples.

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

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

C Programming Examples on Numbers

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

Calendar Programs in C

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

Conversion Programs in C

Following are the list of C programs to Convert

  1. Centimeter to Meter and Kilometer
  2. Celsius to Fahrenheit
  3. Decimal to Binary Number
  4. Decimal to Octal Number
  5. Fahrenheit to Celsius
  6. Kilometer to Meter Centimeter and Millimeter

C Programs on Characters

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

  1. ASCII Value of Single Character
  2. 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. ASCII Value of Total Characters in a String
  2. All Occurrence of a Character in a String
  3. 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

Following are the list of Area programs in C language

  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 Rectangle
  10. Area of a Rectangle using Length and Width
  11. Perimeter of a Rectangle using Length and Width
  12. Area of a Trapezoid
  13. Area of a Right Angled Triangle
  14. Find Area of an Equilateral Triangle

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. Arithmetic Operations on One Dimensional Array
  2. Count Even and Odd Numbers in an Array
  3. Count Positive and Negative Numbers in an Array
  4. 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. Merge Two Arrays
  13. Print Elements in an Array
  14. Put Even and Odd Numbers in two Separate Arrays
  15. Put Positive and Negative Numbers in two Separate Arrays
  16. Print Negative Numbers in an Array
  17. Print Positive Numbers in an Array
  18. Reverse an Array
  19. Search for Element in an Array
  20. Second largest Number in an Array
  21. Smallest Number in an Array
  22. Sort Array in Ascending Order
  23. Sort Array in Descending Order
  24. Sum of all Elements in an Array
  25. Sum of Even and Odd Numbers in an Array
  26. Swap Two Arrays Without Using Temp Variable
  27. Unique Elements in an Array

Matrix Programs

  1. Arithmetic Operations on Multi-Dimensional Arrays
  2. Add two Matrices
  3. Check Two Matrices are Equal or Not
  4. 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

Sort Programs

  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. Exponentially Increasing Star Pattern
  2. Floyd’s Triangle
  3. Hollow Square Star Pattern
  4. Hollow Rectangle Star Pattern
  5. Inverted Right Triangle Star Pattern
  6. Inverted Pyramid Star Pattern
  7. Mirrored Right Triangle Star Pattern
  8. Pascal Triangle
  9. Rectangle Star Pattern
  10. Right Angled Triangle Star Pattern
  11. Reversed Mirrored Right Triangle
  12. Square Star Pattern
  13. Star Pyramid Pattern

C Programming Examples on Number pattern

  1. Box Number Pattern of 1 and 0’s
  2. Hollow Box Number Pattern
  3. Inverted Right Triangle Number Pattern
  4. Print 1 and 0 in Alternative Rows
  5. Print 1 and 0 in Alternative Columns
  6. Right Triangle Number Pattern
  7. Square Number Pattern

C Examples on Number Patterns

Following are the remaining number pattern C programming examples.

C program to Print Number Pattern 1

C program to Print Box Number Pattern of 1 and 0

C program to Print Hollow Box Number Pattern

C program to Print Number Pattern 2

C program to Print Number Pattern 3

C program to Print Number Pattern 4

C program to Print Number Pattern 5

C program to Print Number Pattern 6

C program to Print Number Pattern 7

  • SQL DML, DDL, DCL & TCL Cmds
  • SQL NOT EXISTS Operator
  • SQL UPDATE from SELECT
  • SQL AFTER UPDATE Triggers
  • SQL Get Column Names in Table
  • SQL IF ELSE
  • SQL ACID Properties
  • SQL FOR XML PATH
  • Java Two Dimensional Array
  • Java Perfect Number Program
  • Java Count Digits in a Number
  • C Compare Two Strings Program
  • C Print Prime Numbers 1 to 100
  • C program to Reverse a String
  • C Palindrome Number Program
  • C Program for Palindrome String
  • C Remove Duplicate String Chars
  • C Square of a Number Program
  • C Sum and Average of N Number
  • Python Fibonacci Series program
  • Python Area Of Circle Program
  • Python Prime Numbers 1 to 100
  • Python Program for Leap Year
  • Tableau Rank Calculation
  • Tableau Google Maps usage
  • Power BI Format Dates
  • Power BI Top 10 Filters
  • Power BI – Create Hierarchy
  • Power BI DAX Math Functions
  • Learn SSIS in 28 Days
  • SSIS Transformations
  • SSIS Incremental Load
  • SSRS Drill Through Reports
  • SSRS Drill Down Reports
  • R Programming Tutorial

Copyright © 2021 · All Rights Reserved by Suresh

About Us | Contact Us | Privacy Policy