C Programming Examples

This page contains examples on basic concepts of C programming like: loops, functions, pointers, structures etc. All the examples in this page are tested and verified on GNU GCC compiler, although almost every program on in this website will work on any compiler you use. Feel free to copy the source code and execute it in your device.

C Programming Examples and Source Code
C Program to Print a Sentence
C Program to Print a Integer Entered by a User
C Program to Add Two Integers
C Program to Multiply two Floating Point Numbers
C Program to Find ASCII Value of a Character
C Program to Find Quotient and Remainder of Two Integers Entered by User
C Program to Find Size of int, float, double and char of Your System
C Program to Demonstrate the Working of Keyword long
C Program to Swap Two Numbers
C Program to Check Whether a Number is Even or Odd
C Program to Check Vowel or Consonant
C Program to Find the Largest Number Among Three Numbers
C program to Find all Roots of a Quadratic equation
C Program to Check Leap Year
C Program to Check Whether a Number is Positive or Negative or Zero.
C Program to Check Whether a Character is an Alphabet or not
C Program to Calculate Sum of Natural Numbers
C Program to Find Factorial of a Number
C program to Generate Multiplication Table
C Program to Display Fibonacci Series
C Program to Find HCF of two Numbers
C Program to Find LCM of two Numbers
C Program to Count Number of Digits of an Integer
C Program to Reverse a Number
C program to Calculate the Power of a Number
C Program to Check Whether a Number is Palindrome or Not
C Program to Check Whether a Number is Prime or Not
C Program to Display Prime Numbers Between Two Intervals
C program to Check Armstrong Number
C Program to Display Armstrong Number Between Two Intervals
C program to Display Factors of a Number
C program to Print Pyramids and Triangles in C programming using Loops
C program to Make a Simple Calculator to Add, Subtract, Multiply or Divide Using switch...case
C Program to Display Prime Numbers Between Intervals by Making Function
C Program to Check Prime and Armstrong Number by Making Function
C program to Check Whether a Number can be Express as Sum of Two Prime Numbers
C program to Find Sum of Natural Numbers using Recursion.
C program to Calculate Factorial of a Number Using Recursion
C Program to Find H.C.F Using Recursion
C program to Reverse a Sentence Using Recusrion
C program to Calculate the Power of a Number Using Recursion
C Program to Convert Binary Number to Decimal and Decimal to Binary
C Program to Convert Octal Number to Decimal and Decimal to Octal
C Program to Convert Binary Number to Octal and Octal to Binary
C Program to Calculate Average Using Arrays
C Program to Find Largest Element of an Array
C Program to Calculate Standard Deviation
C Program to Add Two Matrix Using Multi-dimensional Arryas
C Program to Multiply to Matrix Using Multi-dimensional Arrays
C Program to Find Transpose of a Matrix
C Program to Multiply two Matrices by Passing Matrix to Function
C Program to Sort Elements of an Array
C Program to Access Elements of an Array Using Pointer
C Program Swap Numbers in Cyclic Order Using Call by Reference
C Program to Find Largest Number Using Dynamic Memory Allocation
C Program to Find the Frequency of Characters in a String
C Program to Find the Number of Vowels, Consonants, Digits and White space in a String
C Program to Remove all Characters in a String Except Alphabet
C Program to Reverse a String by Passing it to Function
C Program to Find the Length of a String
C program to Concatenate Two Strings
C Program to Copy a String
C Program to Sort Elements in Lexicographical Order (Dictionary Order)
C Program to Change Decimal to Hexadecimal Number and Vice Versa
C Program to Convert Hexadecimal to Octal and Vice Versa
C Program to Convert Binary Number to Hexadecimal Vice Versa
C Program to Store Information(name, roll and marks) of a Student Using Structure
C Program to Add Two Distances (in inch-feet) System Using Structures
C Program to Add Two Complex Numbers by Passing Structure to a Function
C Program to Calculate Difference Between Two Time Period
C Program to Store Information of 10 Students Using Structure
C Program to Store Information Using Structures for n Elements Dynamically
C Program to Write to a Sentence to a File
C Program to Read a String of Text from File
C Program to Display its own Source Code as Output