C Programming Examples
This page contains C programming examples with solution code and output tested on Linux system. It covers examples on C programming concepts like do while loop, while loop, for loop, arrays, strings, functions, recursion, pointers, command line arguments, preprocessor directives, file handling, structures, sorting algorithms.
Note: C programs based on bitwise operators, nested structures and unions, handling text (.txt) files and binary file handling will be added soon. Also complex real world problem solutions using C programming language will be added soon and pdf support will be provided as soon as possible so you can download the programs and use them even if you are offline. Stay tuned for the updates.
Index of C Programs
- Simple C Programs
- Menu driven c programs
- C programs using do while loop
- C programs using while loop
- C programs using for loop
- C programs for patterns
- C programs on arrays
- C programs on strings
- C programs on functions
- C programs on recursion
- C programs on pointers
- C programs on command line arguments and preprocessor directives
- C programs on structures
- C programs on file handling
- C programs on sorting algorithms
- C programs on searching techniques
Simple C programs:
- C Program For Area of Circle
- Find Area To Be Painted In C
- Perform All Arithmetic Operations In C
- C Program To Calculate Gross Salary
- C program to find profit and loss
- C Program To Accept Annual Salary And Print Tax
- Calculate Perimeter And Area of Ring In C
- C Program To Find Distance And Velocity
- Find quadrant in which point lies in c
- C Program To Find Roots of Quadratic Equation In C
- Check First Number is Between Second And Third In C
- C Program To Find Number of Currency Notes
- C Program To Calculate Surface Area And Volume of Cuboid
- C Program To Calculate Circumference of Circle
- Check An Alphabet is Uppercase Or Lowercase In C
- C Program To Find Surface Area And Volume of Cylinder
- C Program To Check Whether The Number is Divisible By 5 And 7
- Check triangle is valid or not in c
- Check time is correct or not in c
- C Program to Convert Temperature in Farenheit to Celsius and Kelvin
- C Program for Arithmetic, Harmonic and Geometric Mean
- C Program To Swap Two Numbers
- C Program To Find Distance Between Two Points
- Check whether character is digit or not in c
- C Program To Display Next And Previous Character of Given Character
- C Program To Find Minimum And Maximum of Three Numbers
- C Program To Check Number is Even or Odd
- C Program To Check Character is Vowel or Consonant
- C Program To Display ASCII Value of a Character
- C Program To Check Given Year is Leap or Not
- C Program To Display A Digit in Word
Menu Driven C Programs:
- Menu Driven C Program To Perform Operations on Two Points
- C Program To Perform Arithmetic Operations On Two Numbers
- C Program To Perform Different Operations On Two Numbers
- C program to display number in words
- C Program To Accept Radius From User And Perform Different Operation It
C Programs Using Do While Loop:
C Programs Using While Loop:
- C Program to Print Sum of Digits of A Number
- C Program to Count Digits of a Number
- C Program to Count Words Characters and Lines till user enters EOF
- C program to find longest line
- C program to convert binary number into decimal
- C program to convert binary number to octal
- C program to convert binary number to hexadecimal
- C program to convert decimal number into octal
- C program to convert decimal number to hexadecimal
- C Program to Convert Octal to Decimal
- C program to convert hexadecimal to binary
C Programs Using For Loop:
- C Program To Display Prime Numbers Between A Range
- C Program To Display Tables For a Range
- C Program To Display First n Fibonacci Numbers (0,1,1,2,3,....
- C Program to Find Factorial of A Number
- C Program for Armstrong Numbers Between 1 to 500
- C Program To Display Multiplication Table
- C Program to check Prime Number
- C program to display even numbers
- C program to display series x+3x+5x+7x+....
- Convert Text String to Binary in C
C Programs For Patterns:
- C Program For Numbers Triangle (Pattern)
- C Program To Display Decreasing Star Triangle (Pattern)
- C Program To Print Triangle of Alphabets (Pattern)
- C Program to Print Inverted Half Triangle of Alphabets (Pattern)
- C program to print or display diamond pattern
- C program to print heart star pattern
C Programs on Arrays:
- C Program To Add Integers of Two Arrays
- C Program To Add Two Matrices
- C Program to Check Identity Matrix
- C Program To Check Whether The Number is Present in The Array or Not
- C Program To Find Minimum Number From Array
- C Program To Print Array In Reverse Order
- C Program to Find Sum of Array Elements
- C Program to Calculate Sum of Array Elements
- C Program To Find Transpose of A Matrix
- C program to count frequency of each element in an array
- C program to find average of array
- C Program to Delete Integer From Array
C Programs on Strings:
- C Program To Check Whether The String is Palindrome or Not
- C Program to check whether the character is present in the string or not
- C Program To Alter Sentence By Replacing Space By *
- C Program To Accept n Strings And Display The Largest
- C Program To Perform Different Operations On Strings
- C Program To Sort Words In Dictionary Order
- Write user defined functions for strcat, strcmp, strupr, strrev
- C Program To Display String In Reverse Order Using Recursion
C Programs on Functions:
- C Program to Check Whether Given Number is Armstrong Number or Not Using Function
- C Program To Check Leap Year
- C Program For User Defined Power Function
- C Program To Find Minimum Number In Array Using Function Up To Certain Position
- C Program To Find Maximum Number in an Array using Function
- C program to convert roman number into decimal
- C program to convert decimal number into it roman equivalent
C Programs on Recursion:
- C Program To Find Factorial Using Recursion
- C Program To Find nth Fibonacci Number Using Recursion
- C Program to Find Sum of Digits of a Number Using Recursion
- C Program to Reverse a Number using While Loop
- C Program to Reverse a Number using Recursion
- C Program To Find Product of Two Numbers Using Recursion
- C Program to Check Number is Prime or Not Using Recursion
C Programs on Pointers
- C Program To Print Address of Memory Location Using Pointer
- C Program To Swap Two Integers Using A Pointer
C Programs on Command Line Arguments And Preprocessor Directives:
- C Program To Accept Three Integers As Command Line Arguments And Find Minimum,Maximum And Average
- C Program To Compare Two Strings Using Macro
- Check Integers Are Equal Or Not Using Macro
- C Program For Finding The Largest of Two Numbers Using Macros
C Programs on Structures:
- C Program To Create A Structure Employee
- C Program To Create Structure Student And To Perform Various Operations On It
- C Program To Create A Structure Library I
- C Program To Create A Structure Library II
C Programs on File Handling:
- C Program To Copy Contents To Another File
- C Program To Count Number of Words,Lines Characters In A File
C Programs on Sorting Algorithms:
C Programs on Bubble Sort:
- C Program For Bubble Sort On Random Array (Ascending Order)
- C Program For Bubble Sort On Random Array (Descending Order)
- C Program To Sort Array Elements In Descending Order Using Bubble Sort
- C Program to Sort File Using Bubble Sort
- C Program to Sort File On Names In Alphabetical Order Using Bubble Sort
C Programs on Insertion Sort:
- C program for insertion sort
- C Program For Insertion Sort On Random Array (Ascending Order)
- C Program For Insertion Sort On Random Array (Descending Order)