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 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
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 GCD of two Numbers
C Program to Find LCM of two Numbers
C Program to Display Character from A to Z Using Loop
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 Programming Code To Create Pyramid and Structure
C Program to Make a Simple Calculator to Add, Subtract, Multiply or Divide Using switch...case
C Program to Display Prime Numbers Between Intervals Using User-defined Function
C Program to Check Prime or Armstrong Number Using User-defined 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 G.C.D Using Recursion
C Program to Convert Binary Number to Decimal and vice-versa
C Program to Convert Octal Number to Decimal and vice-versa
C Program to Convert Binary Number to Octal and vice-versa
C program to Reverse a Sentence Using Recursion
C program to Calculate the Power of a Number Using Recursion
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 Arrays
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 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 Find the Length of a String
C Program to Concatenate Two Strings
C Program to Copy String Without Using strcpy()
C Program to Sort Elements in Lexicographical Order (Dictionary Order)
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 Students Using Structure
C Program to Store Information Using Structures with Dynamically Memory Allocation
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
C Programming Code To Create Pyramid and Pattern