CodeSansar
  • Tutorials ▾
  • Examples ▾
  • Online Calculator
  • Tutorials ▾
  • Examples ▾
  • Online Calculator
  • C program to print Hello, World!
  • Add Two Numbers
  • Multiply Two Numbers
  • Area and Circumference of Circle
  • Rectangle Area & Perimeter
  • Area of an Ellipse
  • Area of Cone
  • Area of Triangle Given Base and Height
  • Calculate Monthly EMI
  • Find Square Root, Logarithmic Value and Exponential Value
  • Cartesian to Polar Coordinate
  • Polar to Cartesian Coordinates
  • Kilometer to Meter Conversion
  • Celsius to Fahrenheit and Kelvin
  • Simple Interest and Compound Interest
  • Convert Time Given in Seconds to Hours, Minutes and Seconds
  • Swap Two Numbers
  • Swap Two Numbers without using Temporary Variable
  • Display ASCII Value
  • Days to Years, Months & Days Conversion
  • Largest of Three Numbers
  • Smallest of Three Numbers
  • Check Whether a Number is Positive, Zero or Negative
  • Even or Odd
  • Even or Odd Using Bitwise Operator
  • Even or Odd Using Conditional Operator
  • Check Leap Year
  • Solve Quadratic Equations
  • Check Whether a Character is Lowercase or not
  • Check Whether a Character is Uppercase or not
  • Check Whether a Character is Alphabet or not
  • Check Whether a Character is Digit or not
  • Check Whether a Character is Vowel or not
  • Check Whether a Character is Consonant or not
  • Convert Lowercase Character to Uppercase Character
  • Uppercase Character to Lowercase Character
  • Check Whether a Character is Vowel or Consonant
  • Find Smallest from N Numbers
  • Find Largest from N Numbers
  • Find Sum and Average of N Numbers
  • Find Factorial of a Given Number
  • Factorial using user defined function
  • Check Whether a Given Number is Prime Number or Not
  • Prime Check User Defined Function in C
  • Convert Decimal Number to Binary Number
  • Decimal to Binary Conversion User Defined Function in C
  • Convert Binary Number to Decimal Number
  • Binary to Decimal Conversion User Defined Function
  • Find HCF (GCD) and LCM of Two Numbers
  • C Program to Find Sum of Digit of a Given Number
  • C Program to Find Reverse of a Given Number
  • C Program to Check Whether a Given Number is Palindrome Number or Not
  • C Program to Check Whether a Given Number is Armstrong Number or Not
  • C Program to Check Whether a Given Number is Strong Number or Not
  • C Program to Check Whether a Given Number is Perfect Number or Not
  • C Program to Check Whether a Given Number is Triangular Number or Not
  • C Program to Check Whether Given Two Numbers are Co-Prime Numbers or Not
  • C Program to generate first n Fibonacci terms
  • C Program to Generate Prime Numbers in Given Minimum to Maximum Ranges
  • C Program to Generate First 50 Prime Numbers
  • C Program to Generate First N Prime Numbers Where N is Given by User
  • C Program to Count Number of Prime Numbers in Given Minimum to Maximum Ranges
  • C Program to Generate Armstrong Numbers in Given Minimum to Maximum Ranges
  • C Program to Generate First N Armstrong Numbers Where N is Given by User
  • C Program to Generate Perfect Numbers in Given Minimum to Maximum Ranges
  • Prime Factors Of A Given Number
  • C Program to Generate Strong Numbers in Given Minimum to Maximum Ranges
  • C Program to Generate Multiplication Table of a Given Number
  • C Program to Generate Multiplication Table of 1 to 10
  • C Program to Read a Number and Displaying Its Digit in Words
  • C Program to Read a Number and Displaying Its Digit in Words in Reverse Order
  • C Program to Generate ASCII Table
  • C Program to Count Number of Digits in Integer Number
  • C Program to Find Sum of First Digit and Last Digit of a Number
  • C Program to Find Sum of Digit of Number Until it Reduces to Single Digit
  • C Program to Check Whether a Given Number is Automorphic (Cyclic) or Not
  • Calculate Value of PI using Leibniz Formula
  • Christmas Tree Pattern C Program
  • Star Pyramid Pattern in C
  • Half Pyramid Star Pattern in C
  • Inverted Star Pyramid Pattern in C
  • Inverted Half Pyramid Star Pattern in C
  • C program to generate PASCAL triangle
  • C Program to Generate Floyd's Triangle
  • C Program to Generate Magic Sqaure
  • Generate Numeric 1-212-32123 Pyramid Pattern in C
  • C Program to Generate Numeric 1-121-12321 Pyramid Pattern in C
  • Print 1-10-101-1010 Number Pattern
  • Print 0-01-010-0101 Number Pattern
  • 1-101-10101 Pyramid Number Pattern
  • Print 0-010-01010 Pyramid Number Pattern
  • Print 1-01-010-1010 Binary Number Pattern
  • Print 0-10-101-0101 Binary Number Pattern
  • PULCHOWK Pattern using Unformatted Function
  • Generate Plus Pattern Using Star
  • Generate Cross Pattern Using Star
  • C Program to Generate Plus Pattern Using Number
  • C Program to Generate Cross Pattern Using Number
  • C Program to Generate Flag of Nepal
  • C Program to Generate Equilateral Triangle Shape Pattern
  • C Program to Generate Diamond Pattern Using Stars
  • C Program to Generate Hollow Diamond Pattern Using Stars
  • C Program to Generate Hollow Star Pyramid Pattern
  • Pattern using word PROGRAMMING and unformatted functions
  • Add Two Complex Number Using Structure
  • Add Two Complex Number Using User Defined Function
  • Multiply Two Complex Number Using Structure
  • Multiply Two Complex Number Using User Defined Function
  • Find Sum & Difference of Start & Stop Time Using Structure & Function
  • Add Two Distance in Feet-Inch System
  • Add Distance in Feet Inch System Using Function
  • Find Difference Between Two Time Periods
  • Add Complex Number Using Structure & Pointer
  • Add Two Complex Number Using Structure, Typedef & Pointer
  • Multiply Two Complex Number Using Structure & Pointer
  • Multiply Complex Number Using Structure, Typedef & Pointer
  • Read Records of Three Students in Structure
  • Read Records of n Students & Display Details of Student Having Highest Marks
  • Read Records of n Different Students in Structure & Sort on the Basis of Marks in Ascending Order
  • Employee Record in Descending Order by Age in Structure
  • Employee Sorted in Alphabetical Order by Name in Structure
  • C Program to Find Factorial Using Recursive Function
  • Sum of Natural Numbers Using Recursion
  • C Program to Print nth Term of Fibonacci Series Using Recursive Function
  • C Program to Find Power Using Recursive Function
  • C Program to Find Sum of Digit of Number Using Recursive Function
  • Generating triangular up to n terms using recursive function
  • Finding Sum of ln(1+x) Using Recursive Function
  • Sum of 1+11+111+1111 ... up to n terms using recursive function
  • C Program to Generate Fibonacci Series Using Recursive Function
  • C Program to Find HCF (GCD) and LCM Using Recursive Function
  • C Program to Reverse Number Using Recursive Function
  • C Program to Read an Array and Displaying its Content
  • C Program to Find Sum & Average of n Numbers in Array
  • C Program to Count Even & Odd Number in Array
  • C Program to Find Largest Element From Array
  • C Program to Find Smallest Element From Array
  • C Program to Find Sum of Even & Add Numbers in Array
  • C Program to Reverse Array
  • C Program to Sort Array in Ascending Order
  • C Program to Sort Array in Descending Order
  • C Program to Find Second Smallest Element from Array
  • C Program to Find Third Smallest Element from Array
  • C Program to Insert Number in Given Position in Array
  • C Program to Merge Two Arrays
  • C Program to Sort an Array in Ascending or Descending Based on Even Count
  • Average of Elements in Array Using User Defined Function in C
  • C Program to Find Standard Deviation (User Defined Function)
  • C Program to Sort An Array in Ascending Order (User Defined Function)
  • C Program to Sort An Array in Descending Order (User Defined Function)
  • C Program to Reverse an Array (User Defined Function)
  • C Program to Find Largest Element from Array (User Defined Function)
  • C Program to Delete Array Element From Given Position
  • C Program to Read & Display 2x3 Matrix in Matrix Form
  • C Program to Read & Display mxn Matrix in Matrix Form
  • C Program to Find Sum & Average of Elements in mxn Matrix
  • C Program to Find Largest Element From mxn Matrix
  • C Program to Find Smallest Element From mxn Matrix
  • C Program to Find Sum of Principal Diagonal Elements of Square Matrix
  • C Program to Find Sum of Both Diagonal Elements of Square Matrix
  • C Program to Replacing Principal Diagonal Elements by Largest in Square Matrix
  • C Program to Transpose Square Matrix
  • C Program to Add Two Matrix
  • C Program to Multiply 3x3 Matrix
  • C Program to Multiply Two PxQ & QxR Matrix
  • Largest Element from Matrix (User Defined Function)
  • Smallest Element from Matrix (User Defined Function)
  • Sum of Both Diagonal of Matrix (User Defined Function)
  • Transpose Square Matrix (User Defined Function)
  • Multiply Two Matrix (User Defined Function)
  • Find Determinant of 2x2 Matrix
  • Program in C to read square matrix of order n, find average of elements and then replace each element by 1 if it is greater than average otherwise replace by 0
  • C Program to find Determinant of Matrix
  • C Program to Check String Palindrome (No String Function)
  • Longest Word From Given Sentence
  • Find Shortest Word From Given Sentence
  • String Length Without strlen()
  • String Length Using User Defined Function
  • String Copy Without strcpy()
  • String Copy User Defined Function
  • Compare String Without strcmp
  • Compare Strings Using User Defined Function
  • String Concatenation Without strcat()
  • String Concatenation User Defined Function
  • Convert String to Lowercase Without strlwr
  • Convert String to Lowercase Using User Defined Function
  • Convert String to Uppercase Without strupr
  • Convert String to Uppercase Using User Defined Function
  • Largest of Three Numbers Using Pointer
  • C Program to find sum of numbers divisible by 7 using pointer
  • Display Value & Address Using Pointer
  • Swap Numbers - Call by Reference
  • Read Array and Display Value & Address Using Pointer
  • Read & Display Array Using Array Itself Pointer
  • Reverse an Array Using Array Itself as a Pointer
  • Read & Display Content from File Using Character I/O Function
  • Count Number of Character in File
  • Count Number of COMMA in Text File
  • Read Content from User & Write to File
  • C program to display employee details in the order of salary from file employee.txt which store employee name, id and salary
  • Multiplying two 3x3 Matrix Using User Defined Function and Displaying Result from Main Function
  • Store Given Integer Number in even.txt if it is Even otherwise to odd.txt until user says no and Displaying the Stored Content in File
  • C Program to Check Whether a Given Number is Automorphic (Cyclic) or Not Using User Defined Function
  • Finding total number of each Product sold and total product sold by each Person
  • Largest and Smallest from mxn Matrix using Pointer and User Defined Function
  • Continuously storing worker details into file and displaying nth records
  • Reversing Array by Returning Array from User Defined Function
  • Storing Largest Element of Each Row From mxn Matrix to One Dimensional Array
  • Reading name, post and salary of 10 different employee and displaying those records whose salary is greater than 10000 using user defined function
  • C Program to Print Star Pyramid in File
  • C Program to Display Characters in Given Range
  • C Program to Copy Content of File from Source to Destination
  • C Program to Convert Date Given in BS to AD
  • Python Programming
  • C Programming
  • Numerical Methods
  • Dart Language
  • Computer Basics
  • Flutter
  • Linux
  • Deep Learning
  • Python Programming
  • C Programming
  • Numerical Methods
  • Dart Language
  • Computer Basics
  • Flutter
  • Linux
  • Deep Learning
  • C Programming Examples
  • Python Programming Examples
  • C Programming Examples
  • Python Programming Examples

C Programming Examples with Output

Large collection of c programming examples with output to explain the concept of different c programming topics like decision making, loops, functions, array, structures, user defined function etc. Choose Examples From Following Category:

Basic C Examples
If Else Examples
Loop Examples
Pattern Examples
Structure Examples
Recursion Examples
1D Array Examples
2D Array Examples
String Examples
Other Examples

Basic C Program Examples

  • C program to print Hello, World!
  • Add Two Numbers
  • Multiply Two Numbers
  • Area and Circumference of Circle
  • Rectangle Area & Perimeter
  • Area of an Ellipse
  • Area of Cone
  • Area of Triangle Given Base and Height
  • Calculate Monthly EMI
  • Find Square Root, Logarithmic Value and Exponential Value
  • Cartesian to Polar Coordinate
  • Polar to Cartesian Coordinates
  • Kilometer to Meter Conversion
  • Celsius to Fahrenheit and Kelvin
  • Simple Interest and Compound Interest
  • Convert Time Given in Seconds to Hours, Minutes and Seconds
  • Swap Two Numbers
  • Swap Two Numbers without using Temporary Variable
  • Display ASCII Value
  • Days to Years, Months & Days Conversion

if-else Examples

  • Largest of Three Numbers
  • Smallest of Three Numbers
  • Check Whether a Number is Positive, Zero or Negative
  • Even or Odd
  • Even or Odd Using Bitwise Operator
  • Even or Odd Using Conditional Operator
  • Check Leap Year
  • Solve Quadratic Equations
  • Check Whether a Character is Lowercase or not
  • Check Whether a Character is Uppercase or not
  • Check Whether a Character is Alphabet or not
  • Check Whether a Character is Digit or not
  • Check Whether a Character is Vowel or not
  • Check Whether a Character is Consonant or not
  • Convert Lowercase Character to Uppercase Character
  • Uppercase Character to Lowercase Character
  • Check Whether a Character is Vowel or Consonant

Loop (for, while, do-while) Examples

  • Find Smallest from N Numbers
  • Find Largest from N Numbers
  • Find Sum and Average of N Numbers
  • Find Factorial of a Given Number
  • Factorial using user defined function
  • Check Whether a Given Number is Prime Number or Not
  • Prime Check User Defined Function in C
  • Convert Decimal Number to Binary Number
  • Decimal to Binary Conversion User Defined Function in C
  • Convert Binary Number to Decimal Number
  • Binary to Decimal Conversion User Defined Function
  • Find HCF (GCD) and LCM of Two Numbers
  • C Program to Find Sum of Digit of a Given Number
  • C Program to Find Reverse of a Given Number
  • C Program to Check Whether a Given Number is Palindrome Number or Not
  • C Program to Check Whether a Given Number is Armstrong Number or Not
  • C Program to Check Whether a Given Number is Strong Number or Not
  • C Program to Check Whether a Given Number is Perfect Number or Not
  • C Program to Check Whether a Given Number is Triangular Number or Not
  • C Program to Check Whether Given Two Numbers are Co-Prime Numbers or Not
  • C Program to generate first n Fibonacci terms
  • C Program to Generate Prime Numbers in Given Minimum to Maximum Ranges
  • C Program to Generate First 50 Prime Numbers
  • C Program to Generate First N Prime Numbers Where N is Given by User
  • C Program to Count Number of Prime Numbers in Given Minimum to Maximum Ranges
  • C Program to Generate Armstrong Numbers in Given Minimum to Maximum Ranges
  • C Program to Generate First N Armstrong Numbers Where N is Given by User
  • C Program to Generate Perfect Numbers in Given Minimum to Maximum Ranges
  • Prime Factors Of A Given Number
  • C Program to Generate Strong Numbers in Given Minimum to Maximum Ranges
  • C Program to Generate Multiplication Table of a Given Number
  • C Program to Generate Multiplication Table of 1 to 10
  • C Program to Read a Number and Displaying Its Digit in Words
  • C Program to Read a Number and Displaying Its Digit in Words in Reverse Order
  • C Program to Generate ASCII Table
  • C Program to Count Number of Digits in Integer Number
  • C Program to Find Sum of First Digit and Last Digit of a Number
  • C Program to Find Sum of Digit of Number Until it Reduces to Single Digit
  • C Program to Check Whether a Given Number is Automorphic (Cyclic) or Not
  • Calculate Value of PI using Leibniz Formula

Different Patterns in C

  • Christmas Tree Pattern C Program
  • Star Pyramid Pattern in C
  • Half Pyramid Star Pattern in C
  • Inverted Star Pyramid Pattern in C
  • Inverted Half Pyramid Star Pattern in C
  • C program to generate PASCAL triangle
  • C Program to Generate Floyd's Triangle
  • C Program to Generate Magic Sqaure
  • Generate Numeric 1-212-32123 Pyramid Pattern in C
  • C Program to Generate Numeric 1-121-12321 Pyramid Pattern in C
  • Print 1-10-101-1010 Number Pattern
  • Print 0-01-010-0101 Number Pattern
  • 1-101-10101 Pyramid Number Pattern
  • Print 0-010-01010 Pyramid Number Pattern
  • Print 1-01-010-1010 Binary Number Pattern
  • Print 0-10-101-0101 Binary Number Pattern
  • PULCHOWK Pattern using Unformatted Function
  • Generate Plus Pattern Using Star
  • Generate Cross Pattern Using Star
  • C Program to Generate Plus Pattern Using Number
  • C Program to Generate Cross Pattern Using Number
  • C Program to Generate Flag of Nepal
  • C Program to Generate Equilateral Triangle Shape Pattern
  • C Program to Generate Diamond Pattern Using Stars
  • C Program to Generate Hollow Diamond Pattern Using Stars
  • C Program to Generate Hollow Star Pyramid Pattern
  • Pattern using word PROGRAMMING and unformatted functions

Structure Examples

  • Add Two Complex Number Using Structure
  • Add Two Complex Number Using User Defined Function
  • Multiply Two Complex Number Using Structure
  • Multiply Two Complex Number Using User Defined Function
  • Find Sum & Difference of Start & Stop Time Using Structure & Function
  • Add Two Distance in Feet-Inch System
  • Add Distance in Feet Inch System Using Function
  • Find Difference Between Two Time Periods
  • Add Complex Number Using Structure & Pointer
  • Add Two Complex Number Using Structure, Typedef & Pointer
  • Multiply Two Complex Number Using Structure & Pointer
  • Multiply Complex Number Using Structure, Typedef & Pointer
  • Read Records of Three Students in Structure
  • Read Records of n Students & Display Details of Student Having Highest Marks
  • Read Records of n Different Students in Structure & Sort on the Basis of Marks in Ascending Order
  • Employee Record in Descending Order by Age in Structure
  • Employee Sorted in Alphabetical Order by Name in Structure

Recursion Examples

  • C Program to Find Factorial Using Recursive Function
  • Sum of Natural Numbers Using Recursion
  • C Program to Print nth Term of Fibonacci Series Using Recursive Function
  • C Program to Find Power Using Recursive Function
  • C Program to Find Sum of Digit of Number Using Recursive Function
  • Generating triangular up to n terms using recursive function
  • Finding Sum of ln(1+x) Using Recursive Function
  • Sum of 1+11+111+1111 ... up to n terms using recursive function
  • C Program to Generate Fibonacci Series Using Recursive Function
  • C Program to Find HCF (GCD) and LCM Using Recursive Function
  • C Program to Reverse Number Using Recursive Function

1D Array Examples

  • C Program to Read an Array and Displaying its Content
  • C Program to Find Sum & Average of n Numbers in Array
  • C Program to Count Even & Odd Number in Array
  • C Program to Find Largest Element From Array
  • C Program to Find Smallest Element From Array
  • C Program to Find Sum of Even & Add Numbers in Array
  • C Program to Reverse Array
  • C Program to Sort Array in Ascending Order
  • C Program to Sort Array in Descending Order
  • C Program to Find Second Smallest Element from Array
  • C Program to Find Third Smallest Element from Array
  • C Program to Insert Number in Given Position in Array
  • C Program to Merge Two Arrays
  • C Program to Sort an Array in Ascending or Descending Based on Even Count
  • Average of Elements in Array Using User Defined Function in C
  • C Program to Find Standard Deviation (User Defined Function)
  • C Program to Sort An Array in Ascending Order (User Defined Function)
  • C Program to Sort An Array in Descending Order (User Defined Function)
  • C Program to Reverse an Array (User Defined Function)
  • C Program to Find Largest Element from Array (User Defined Function)
  • C Program to Delete Array Element From Given Position

2D Array Examples

  • C Program to Read & Display 2x3 Matrix in Matrix Form
  • C Program to Read & Display mxn Matrix in Matrix Form
  • C Program to Find Sum & Average of Elements in mxn Matrix
  • C Program to Find Largest Element From mxn Matrix
  • C Program to Find Smallest Element From mxn Matrix
  • C Program to Find Sum of Principal Diagonal Elements of Square Matrix
  • C Program to Find Sum of Both Diagonal Elements of Square Matrix
  • C Program to Replacing Principal Diagonal Elements by Largest in Square Matrix
  • C Program to Transpose Square Matrix
  • C Program to Add Two Matrix
  • C Program to Multiply 3x3 Matrix
  • C Program to Multiply Two PxQ & QxR Matrix
  • Largest Element from Matrix (User Defined Function)
  • Smallest Element from Matrix (User Defined Function)
  • Sum of Both Diagonal of Matrix (User Defined Function)
  • Transpose Square Matrix (User Defined Function)
  • Multiply Two Matrix (User Defined Function)
  • Find Determinant of 2x2 Matrix
  • Program in C to read square matrix of order n, find average of elements and then replace each element by 1 if it is greater than average otherwise replace by 0
  • C Program to find Determinant of Matrix

String Examples

  • C Program to Check String Palindrome (No String Function)
  • Longest Word From Given Sentence
  • Find Shortest Word From Given Sentence
  • String Length Without strlen()
  • String Length Using User Defined Function
  • String Copy Without strcpy()
  • String Copy User Defined Function
  • Compare String Without strcmp
  • Compare Strings Using User Defined Function
  • String Concatenation Without strcat()
  • String Concatenation User Defined Function
  • Convert String to Lowercase Without strlwr
  • Convert String to Lowercase Using User Defined Function
  • Convert String to Uppercase Without strupr
  • Convert String to Uppercase Using User Defined Function

Pointer Examples

  • Largest of Three Numbers Using Pointer
  • C Program to find sum of numbers divisible by 7 using pointer
  • Display Value & Address Using Pointer
  • Swap Numbers - Call by Reference
  • Read Array and Display Value & Address Using Pointer
  • Read & Display Array Using Array Itself Pointer
  • Reverse an Array Using Array Itself as a Pointer

File Handling

  • Read & Display Content from File Using Character I/O Function
  • Count Number of Character in File
  • Count Number of COMMA in Text File
  • Read Content from User & Write to File

Other Examples

  • C program to display employee details in the order of salary from file employee.txt which store employee name, id and salary
  • Multiplying two 3x3 Matrix Using User Defined Function and Displaying Result from Main Function
  • Store Given Integer Number in even.txt if it is Even otherwise to odd.txt until user says no and Displaying the Stored Content in File
  • C Program to Check Whether a Given Number is Automorphic (Cyclic) or Not Using User Defined Function
  • Finding total number of each Product sold and total product sold by each Person
  • Largest and Smallest from mxn Matrix using Pointer and User Defined Function
  • Continuously storing worker details into file and displaying nth records
  • Reversing Array by Returning Array from User Defined Function
  • Storing Largest Element of Each Row From mxn Matrix to One Dimensional Array
  • Reading name, post and salary of 10 different employee and displaying those records whose salary is greater than 10000 using user defined function
  • C Program to Print Star Pyramid in File
  • C Program to Display Characters in Given Range
  • C Program to Copy Content of File from Source to Destination
  • C Program to Convert Date Given in BS to AD
  • Basic C Program Examples
    • C program to print Hello, World!
    • Add Two Numbers
    • Multiply Two Numbers
    • Area and Circumference of Circle
    • Rectangle Area & Perimeter
    • Area of an Ellipse
    • Area of Cone
    • Area of Triangle Given Base and Height
    • Calculate Monthly EMI
    • Find Square Root, Logarithmic Value and Exponential Value
    • Cartesian to Polar Coordinate
    • Polar to Cartesian Coordinates
    • Kilometer to Meter Conversion
    • Celsius to Fahrenheit and Kelvin
    • Simple Interest and Compound Interest
    • Convert Time Given in Seconds to Hours, Minutes and Seconds
    • Swap Two Numbers
    • Swap Two Numbers without using Temporary Variable
    • Display ASCII Value
    • Days to Years, Months & Days Conversion
  • if-else Examples
    • Largest of Three Numbers
    • Smallest of Three Numbers
    • Check Whether a Number is Positive, Zero or Negative
    • Even or Odd
    • Even or Odd Using Bitwise Operator
    • Even or Odd Using Conditional Operator
    • Check Leap Year
    • Solve Quadratic Equations
    • Check Whether a Character is Lowercase or not
    • Check Whether a Character is Uppercase or not
    • Check Whether a Character is Alphabet or not
    • Check Whether a Character is Digit or not
    • Check Whether a Character is Vowel or not
    • Check Whether a Character is Consonant or not
    • Convert Lowercase Character to Uppercase Character
    • Uppercase Character to Lowercase Character
    • Check Whether a Character is Vowel or Consonant
  • Loop (for, while, do-while) Examples
    • Find Smallest from N Numbers
    • Find Largest from N Numbers
    • Find Sum and Average of N Numbers
    • Find Factorial of a Given Number
    • Factorial using user defined function
    • Check Whether a Given Number is Prime Number or Not
    • Prime Check User Defined Function in C
    • Convert Decimal Number to Binary Number
    • Decimal to Binary Conversion User Defined Function in C
    • Convert Binary Number to Decimal Number
    • Binary to Decimal Conversion User Defined Function
    • Find HCF (GCD) and LCM of Two Numbers
    • C Program to Find Sum of Digit of a Given Number
    • C Program to Find Reverse of a Given Number
    • C Program to Check Whether a Given Number is Palindrome Number or Not
    • C Program to Check Whether a Given Number is Armstrong Number or Not
    • C Program to Check Whether a Given Number is Strong Number or Not
    • C Program to Check Whether a Given Number is Perfect Number or Not
    • C Program to Check Whether a Given Number is Triangular Number or Not
    • C Program to Check Whether Given Two Numbers are Co-Prime Numbers or Not
    • C Program to generate first n Fibonacci terms
    • C Program to Generate Prime Numbers in Given Minimum to Maximum Ranges
    • C Program to Generate First 50 Prime Numbers
    • C Program to Generate First N Prime Numbers Where N is Given by User
    • C Program to Count Number of Prime Numbers in Given Minimum to Maximum Ranges
    • C Program to Generate Armstrong Numbers in Given Minimum to Maximum Ranges
    • C Program to Generate First N Armstrong Numbers Where N is Given by User
    • C Program to Generate Perfect Numbers in Given Minimum to Maximum Ranges
    • Prime Factors Of A Given Number
    • C Program to Generate Strong Numbers in Given Minimum to Maximum Ranges
    • C Program to Generate Multiplication Table of a Given Number
    • C Program to Generate Multiplication Table of 1 to 10
    • C Program to Read a Number and Displaying Its Digit in Words
    • C Program to Read a Number and Displaying Its Digit in Words in Reverse Order
    • C Program to Generate ASCII Table
    • C Program to Count Number of Digits in Integer Number
    • C Program to Find Sum of First Digit and Last Digit of a Number
    • C Program to Find Sum of Digit of Number Until it Reduces to Single Digit
    • C Program to Check Whether a Given Number is Automorphic (Cyclic) or Not
    • Calculate Value of PI using Leibniz Formula
  • Different Patterns in C
    • Christmas Tree Pattern C Program
    • Star Pyramid Pattern in C
    • Half Pyramid Star Pattern in C
    • Inverted Star Pyramid Pattern in C
    • Inverted Half Pyramid Star Pattern in C
    • C program to generate PASCAL triangle
    • C Program to Generate Floyd's Triangle
    • C Program to Generate Magic Sqaure
    • Generate Numeric 1-212-32123 Pyramid Pattern in C
    • C Program to Generate Numeric 1-121-12321 Pyramid Pattern in C
    • Print 1-10-101-1010 Number Pattern
    • Print 0-01-010-0101 Number Pattern
    • 1-101-10101 Pyramid Number Pattern
    • Print 0-010-01010 Pyramid Number Pattern
    • Print 1-01-010-1010 Binary Number Pattern
    • Print 0-10-101-0101 Binary Number Pattern
    • PULCHOWK Pattern using Unformatted Function
    • Generate Plus Pattern Using Star
    • Generate Cross Pattern Using Star
    • C Program to Generate Plus Pattern Using Number
    • C Program to Generate Cross Pattern Using Number
    • C Program to Generate Flag of Nepal
    • C Program to Generate Equilateral Triangle Shape Pattern
    • C Program to Generate Diamond Pattern Using Stars
    • C Program to Generate Hollow Diamond Pattern Using Stars
    • C Program to Generate Hollow Star Pyramid Pattern
    • Pattern using word PROGRAMMING and unformatted functions
  • Structure Examples
    • Add Two Complex Number Using Structure
    • Add Two Complex Number Using User Defined Function
    • Multiply Two Complex Number Using Structure
    • Multiply Two Complex Number Using User Defined Function
    • Find Sum & Difference of Start & Stop Time Using Structure & Function
    • Add Two Distance in Feet-Inch System
    • Add Distance in Feet Inch System Using Function
    • Find Difference Between Two Time Periods
    • Add Complex Number Using Structure & Pointer
    • Add Two Complex Number Using Structure, Typedef & Pointer
    • Multiply Two Complex Number Using Structure & Pointer
    • Multiply Complex Number Using Structure, Typedef & Pointer
    • Read Records of Three Students in Structure
    • Read Records of n Students & Display Details of Student Having Highest Marks
    • Read Records of n Different Students in Structure & Sort on the Basis of Marks in Ascending Order
    • Employee Record in Descending Order by Age in Structure
    • Employee Sorted in Alphabetical Order by Name in Structure
  • Recursion Examples
    • C Program to Find Factorial Using Recursive Function
    • Sum of Natural Numbers Using Recursion
    • C Program to Print nth Term of Fibonacci Series Using Recursive Function
    • C Program to Find Power Using Recursive Function
    • C Program to Find Sum of Digit of Number Using Recursive Function
    • Generating triangular up to n terms using recursive function
    • Finding Sum of ln(1+x) Using Recursive Function
    • Sum of 1+11+111+1111 ... up to n terms using recursive function
    • C Program to Generate Fibonacci Series Using Recursive Function
    • C Program to Find HCF (GCD) and LCM Using Recursive Function
    • C Program to Reverse Number Using Recursive Function
  • 1D Array Examples
    • C Program to Read an Array and Displaying its Content
    • C Program to Find Sum & Average of n Numbers in Array
    • C Program to Count Even & Odd Number in Array
    • C Program to Find Largest Element From Array
    • C Program to Find Smallest Element From Array
    • C Program to Find Sum of Even & Add Numbers in Array
    • C Program to Reverse Array
    • C Program to Sort Array in Ascending Order
    • C Program to Sort Array in Descending Order
    • C Program to Find Second Smallest Element from Array
    • C Program to Find Third Smallest Element from Array
    • C Program to Insert Number in Given Position in Array
    • C Program to Merge Two Arrays
    • C Program to Sort an Array in Ascending or Descending Based on Even Count
    • Average of Elements in Array Using User Defined Function in C
    • C Program to Find Standard Deviation (User Defined Function)
    • C Program to Sort An Array in Ascending Order (User Defined Function)
    • C Program to Sort An Array in Descending Order (User Defined Function)
    • C Program to Reverse an Array (User Defined Function)
    • C Program to Find Largest Element from Array (User Defined Function)
    • C Program to Delete Array Element From Given Position
  • 2D Array Examples
    • C Program to Read & Display 2x3 Matrix in Matrix Form
    • C Program to Read & Display mxn Matrix in Matrix Form
    • C Program to Find Sum & Average of Elements in mxn Matrix
    • C Program to Find Largest Element From mxn Matrix
    • C Program to Find Smallest Element From mxn Matrix
    • C Program to Find Sum of Principal Diagonal Elements of Square Matrix
    • C Program to Find Sum of Both Diagonal Elements of Square Matrix
    • C Program to Replacing Principal Diagonal Elements by Largest in Square Matrix
    • C Program to Transpose Square Matrix
    • C Program to Add Two Matrix
    • C Program to Multiply 3x3 Matrix
    • C Program to Multiply Two PxQ & QxR Matrix
    • Largest Element from Matrix (User Defined Function)
    • Smallest Element from Matrix (User Defined Function)
    • Sum of Both Diagonal of Matrix (User Defined Function)
    • Transpose Square Matrix (User Defined Function)
    • Multiply Two Matrix (User Defined Function)
    • Find Determinant of 2x2 Matrix
    • Program in C to read square matrix of order n, find average of elements and then replace each element by 1 if it is greater than average otherwise replace by 0
    • C Program to find Determinant of Matrix
  • String Examples
    • C Program to Check String Palindrome (No String Function)
    • Longest Word From Given Sentence
    • Find Shortest Word From Given Sentence
    • String Length Without strlen()
    • String Length Using User Defined Function
    • String Copy Without strcpy()
    • String Copy User Defined Function
    • Compare String Without strcmp
    • Compare Strings Using User Defined Function
    • String Concatenation Without strcat()
    • String Concatenation User Defined Function
    • Convert String to Lowercase Without strlwr
    • Convert String to Lowercase Using User Defined Function
    • Convert String to Uppercase Without strupr
    • Convert String to Uppercase Using User Defined Function
  • Pointer Examples
    • Largest of Three Numbers Using Pointer
    • C Program to find sum of numbers divisible by 7 using pointer
    • Display Value & Address Using Pointer
    • Swap Numbers - Call by Reference
    • Read Array and Display Value & Address Using Pointer
    • Read & Display Array Using Array Itself Pointer
    • Reverse an Array Using Array Itself as a Pointer
  • File Handling
    • Read & Display Content from File Using Character I/O Function
    • Count Number of Character in File
    • Count Number of COMMA in Text File
    • Read Content from User & Write to File
  • Other Examples
    • C program to display employee details in the order of salary from file employee.txt which store employee name, id and salary
    • Multiplying two 3x3 Matrix Using User Defined Function and Displaying Result from Main Function
    • Store Given Integer Number in even.txt if it is Even otherwise to odd.txt until user says no and Displaying the Stored Content in File
    • C Program to Check Whether a Given Number is Automorphic (Cyclic) or Not Using User Defined Function
    • Finding total number of each Product sold and total product sold by each Person
    • Largest and Smallest from mxn Matrix using Pointer and User Defined Function
    • Continuously storing worker details into file and displaying nth records
    • Reversing Array by Returning Array from User Defined Function
    • Storing Largest Element of Each Row From mxn Matrix to One Dimensional Array
    • Reading name, post and salary of 10 different employee and displaying those records whose salary is greater than 10000 using user defined function
    • C Program to Print Star Pyramid in File
    • C Program to Display Characters in Given Range
    • C Program to Copy Content of File from Source to Destination
    • C Program to Convert Date Given in BS to AD
About Us

Codesansar is online platform that provides tutorials and examples on popular programming languages.

Links
  • About Us
  • Contact Us
  • Privacy Policy
  • Cookies Policy
Social Media
  • Facebook
  • Twitter
  • Youtube
  • Github
  • Instagram
© 2023 Codesansar. All Rights Reserved.