Home / C Programming / C Program Examples

# C Program Examples

Chapter 1: Basic C programs

No                   Programs

1. Print Hello Word
2. Declaring Variable and Printing its Value

Chapter 2: Area Programs

 No Programs 1 C Program to Calculate Area and Circumference2 of Circle 2 C Program to Calculate Area of Scalene Triange 3 C Program to Calculate Area of Equilatral Triangle 4 C Program to Calculate Area of Right angle Triangle 5 C Program to Calculate Area of Circle 6 C Program to Calculate Area of Rectangle 7 C Program to Calculate Area of Square 8 C Program to Calculate Area of Circle using Pointer

Chapter 3: Mathematical Programs

 No Programs 1 Compute sum of the array elements using pointers! 2 Find exponent Power Series !! 3 Read the value of x y and z and print the results expressions in one line. 4 Reads customer number and power consumed and prints amount to be paid 5 Find greatest in 3 numbers 6 Calculate gross salary of a person 7 Reverswe a given number ! 8 Calculate sum of 5 subjects and Find percentage 9 Convert temperature from degree centigrade to Fahrenheit 10 Find the simple interest 11 Find area and circumference of circle 12 Find sum of two numbers 13 Solve Second Order Quardratic Equation 14 Find Factorial of Number Using Recursion 15 Find Factorial of Number without using function 16 Print table of n and square of n using pow ()

Chapter 4:  Number Programs in C Programming

 No Programs 1 Calendar Program in C Programing Language: Display Day of the month 2 Find greatest in 3 numbers 3 Reverse a given number ! 4 Swap of two no’s without using third variable 5 Calculate sum of 5 subjects and find percentage 6 Find sum of two numbers 7 Generate the Fibonacci Series starting from any two numbers 8 Print First 10  Natural Numbers 9 Find Factorial of Number Using Recursion 10 Check Whether Given Number is Palindrome of Not? 11 Check Whether Number is Prime of not 12 Check for Armstrong Number in C 13 Check Whether  Number is Perfect Or Not 14 Print All ASCII Value Table in C Programing 15 Find Factorial of Number without using function

Chapter 5: 1-D Array Programs

 No Programs 1 C Program to implement Slack Operation Using Array 2 C Program to read integers into an array and  reversing them using pointers 3 C Program to delete duplicate elements in an array 4 C Program to calculate Addition of All Elements in Array 5 C Program to find Largest Element in Array in C Programming 6 C Program to Smallest Element in Array in C Programming 7 C Program to reversing an Array Elements in C Programming 8 Merging of Two arrays inn C Programming 9 Searcing elements in array 10 copy all elements of an array into another array in C 11 Program Insert elements in an Array 12 Program for deletion on an elements from the specified location from Array 13 Printing Array Elements in C Language 14 C Program: Rading Array Elements 15 One Dimensional Array All Programs

2-D Array Programs: C Programming

 No Programs 1 C Program to Check whether Matrix is Magic Squared of  Not? 2 C Program to Print Square of Each Elements of 2D Array Matrix 3 Program to find Transpose of Given Square Matrix 4 C Program to find addition of Lower Triangular Elements in C Programing 5 C Program to  calculate sum of Upper Triangular Elements in C 6 C Program to evaluate Subtraction of two matrices (matrix) in C 7 C Program for addition of two matrices in C 8 Addition of Diagonal Elements in Matrix 9 Addition of All Elements in Matrix 10 Accessing 2-D Array Elements In C Programming 11 C Program to Find Inverse Of 3 x 3 Matrix in 10 Lines 12 C Program to Multiply Two 3 X 3 Maatrices

Algorithms Programs: C Programming

 No Programs 1 C Program to Implement N Queen’s Problem using Backtracking 2 C Program to implements primes algorithm using greedy method 3 Program to implement knapsack problem using greedy method

Command Line Arguments Programs: C Programming

 No Programs 1 How to print all Arguments passed using Command Line in C!

Conversion Programs: C Programming

 No Programs 1 C Program to convert temperature from degree centigrade to Fahrenheit 2 Decimal to Binary using Bitwise and operator 3 Program to convert Binary to Decimal number: Number System 4 Program for Decimal to Hexadecimal Conversion in C >>  Number System 5 Program for Decimal number to Octal Conversion: Number System 6 Program to Convert Decimal number into Binary: Number System:

Dos Programs: C Programming

 No Programs 1 How to print all Arguments passed using Command Line in C! 2 C Program to Add two numbers using Command Line Arguments Parameters

Expressions Programs: C Programming

 No Programs 1 C Program to demonstrates binary expressions using floating point arithmetic 2 C Program to demonstrates binary expressions using interger arithmetic !

File Handling Programs: C Programming

 No Programs 1 C program to copy the contents of one file into another using fputc 2 C program to read last n character from the file! 3 C program to convert the file contents in Upper-case & Write Contents in a output file 4 C program to Compare two text/data files in C Programming 5 C program to Write on Data File and Read From Data File 6 C program to Copy Text From One File to  Other File 7 How to display same source code as output inn c programming?

Electrical Programming: C Programming

 No Programs 1 C Programs Electrical Circuit Formulae Verification 2 C program to find equivalent capacitance of parallel combination of capacitive circuit 3 C program to find equivalent capacitance of series combination of capacitive circuit 4 Program To find equivalent resistance of Parallel combination of  resistive circuits 5 Program To find equivalent resistance of series combination of resistive circuits

Graphics Programs: C Programming

 No Programs 1 Drawing Line in Graphics Mode: Line Function 2 C Program to draw Inductive Coil using Graphics Function 3 C Program to draw  Resistance using Graphics Function 4 C Program to draw PNP Transistor using Graphics Function 5 C Program to draw Eclipse using Graphics Function 6 C Program to draw NPN Trasistor using Graphics Function 7 C Program to draw Capacitor using Graphics Function 8 C Program to draw a Triangle using Graphics Function 9 Printing Text in Graphics Using Outtextsy Function 10 First Turbo Graphics Program in C Language 11 C Program to draw Op-amp Symbol Using Graphics Function 12 C Program to display mouse pointer in texmode 13 C Program to cheak if mouse support is available or not 14 Drawing circle in Graphics Mode: Circle Function>> Graphics.h

Mouse Programs: C Programming

 No Programs 1 C Program to display mouse pointer in textmode 2 C Program to Check if mouse support is available or not

Point programs: C Programming

 No Programs 1 C Program to Swap Two Numbers/Variables using Pointer103”> C Program to Print value and Address of Variable of pointer 2 C Program to perform Stack Operations Using Pointer ! 3 C Program to compute sum of the array elements using pointers ! 4 C Program to count number of words digits and vowels using pointers in C Programming 5 C Program to Find Length of the Sttring using Pointer 6 C Program to read integers into an array and reversing them using pointers 7 C Program to Add Two Numbers Using Pointer ! 8 C Program to Calculate Size of Pointer in  C Programming 9 Pointer Program: Difference between two float Pointers 10 Pointer Program: Difference between two integer Pointers 11 Pointer Program: Increment Structure Pointer having far pointer as structure member 12 Pointer Program: Incrementing Array of Float pointer 13 Pointer Program: Incrementing Double Pointer 14 Pointer Program: Incrementing Integer Pointer 15 Pointer Program: Declaring Pointer 16 Pointer Program: Adress operator in C 17 C Program to calculate Area of Circle using Pointer 18 C Program to Accessing Value from Address using Pointer 19 C Program to Access Address of Variable using Pointer

Pyramid Programs: C Programming

 No Programs 1 Pyramid Program in C Programming-Mirror Image of Right Angled Triangle666’>How to write c program to print FLOYD’S triangle in C programming? 2 Number Pyramid Pattern in C Programming 3 Program Even Number Pyramid in C 4 Print prime number Pyramid in C 5 Print the Rectangle using Line and Special Symbols 6 Number  Pyramid in C Programming 7 Program to print Largest Number Pyramid 8 Program to Print the Double Pyramid Pattern 9 Program to Print Pyramid of Multiplication Tables 10 Program to print 1-10 Numbers in Pyramid fashion 11 C Program to Print Inverted Pyramid 12 Print the Pattern of Binary Numbers (Pyramid) 13 Program to Print this Right angled Pyramid in C using Nested Loops in C 14 Index: Pyramid Program in C Programming

Recursive Programs: C Programming

 No Programs 1 C Program to print Fibonacci Series using recursion !!662”>C Program to Multiply two Matrices using Recursion !! 2 C Program to calculate sum of numbers 1 to N using recursion 3 Find Sum of Digits of the Number using Recursive Funtion in C Programming 4 C Program to print Tower of Hanoi using recursion !! 5 Find Factorial of number Using Recursion

C Programs: Series

 No Programs 1 C Program to find exponent Power Series !!

C Programs: Size of Operator

 No Programs 1 C Program to Calculate Size of Structure using Sizeof Operator 2 Pointer Program: Size of Pointer to Structure 3 Pointer Program: Size of Integer Far Pointer 4 Pointer Program: Size of Float Pointer 5 Pointer Program: Size of Character Pointer 6 Pointer Program: Size of Integer Pointer

C Programs: Sorting

 No Programs 1 C Program to short array of Structure in C Programming 2 C Program for sorting the list of Strings 3 C Program to Implement Bubble Sort in C programming 4 Sorting Two Structures on the basis of any structure element and Display Information 5 Program to Implement Insertion Sort in C Programming

C Programs: Stack

 No Programs 1 C Program to perform Stack Operations Using Pointer ! 2 C Program to implement Stack Operations Using Array 3 C Program to implement Stack Operations Using Singly Linked List

C Programs: String Operations With using Library Function

 No Program 1 C Program to sort set of strings in alphabetical order using stremp () 2 C Program to Convert String to Integer !! 3 Program to convert String into Upercase Using Library Function 4 Program to convert string into Lowercase Using Library Function 5 Program to copy one string into other with using library function [strcpy] 6 Program to concat Two Strings with using Library Function: Strcat 7 Find Length of String Using Library Function

C Programs: String Operations Without using Library Function

 No Programs 1 C Program to count number of words digits and vowels using pointers in c Programming 2 C Program for sorting the list of Strings 3 C Program to Find Length of the String using pointer 4 Write a C Program to Reverse Letter in Each Word of the Entered String 5 C Program to Encode a String and Display Encoded String! 6 C Program to Delete all occurrences of Character from the String 7 C Program to Concat Two Strings without Using Library Function 8 C Program to Find Substring of String Without Using Library Function! 9 C Program: Reverse String Without Using Library Function [Strrev] 10 C Program to Compare Two Strings Without Using Library Function [Strcmp] 11 C Program to coy one String into Other Without Using Library Function 12 Check Whether Character is Lowercase or Not without using Library Function 13 Check Whether Character is uppercase or Not without using Library Function 14 C Program to Count number of Uppercase and Lowecase Letters 15 Search occurrence of Character in String: 16 With using User-Defined Function Write a Program to Find Length of String 17 Program to  Find Length of String Without using Library Function

S Programs: Structure Concept

 No Programs 1 C Program to  read and print name and other details of 50 students using Structure? 2 C Program to   sort array of Structure in C Programming 3 C Program to   use structure within union & display the contents of structure elements 4 C Program to   Calculate Size of Structure using Sizeof Oprator 5 Sorting Two Structures on the basis of any structure element and display Information

C Programs: Typical Programs

 No Programs 1 Calender Program in C Programming Language:  Display Day of the month 2 C Program to show swap of two no’s without using third variable 3 How to write c program to count number of digits in number without using mod operator? 4 How to Input Password in C: Validation of User name 5 How to write inline assembly language code inside C Program? 6 Accept Paragraph using scanf in C 7 Print Hello word without using semicolon in C 8 Nested Printf statements: Example 2 9 Printf inside printf in C: Example 1 10 C Program to add reversed number with Original Number? 11 C Program to reverse the digits of a number? [In 3  Steps] 12 How to add digits of the Number Using Single Statement? 13 Swap two numbers sithout using third variable and using XOR Operator in C Programming 14 How to Add two numbers without using arithmetic Operators in C Programming? 15 How to Create You Own Header File in C Programming? 16 How to write C Program without using Main Function ((in 3  ways) 17 Swap/Interchange two variables [numbers] without using Third Varible 18 How do I Return Multiple Values From a Function 19 C Program to  Create directory in C  Using Interrupts. 20 How to use Interrupts in C Programming? 21 How to print 1-10 numbers without using Conditional Loop in C Programming?

Category: 02

Elementary

Write a program the prints ‘Hello World’ to the screen.

Write a program the basks the user for his name and greets him with his name.

Modify the previous program such that only the users Alice and Bob are greeted with their names.

Write a program that asks the user for a number n and prints the sum of the numbers I to n

Modify the previous program such that only multiples of three or five are considered in the sum, e,g,3,5,6,9,10,12,15  for n=17

Write a program that asks the user for a number n and gives him the possibility to choose between computing the sum and computing the product of 1,…….,n.

Write a program that prints all prime numbers.

Write a pgoram that prints the next 20 leap years.

Write a program that computes.

Lists, Strings

Write a function that returns the largest element in a list.

Write a function that reverses a list, preferably in place

Write a function that checks whether an element occurs in a list

Write a function that returns the elements on odd positions in a list.

Write a function that tests whether a string is a palindrome.

Write a function that compute the sum of the numbers in a list: using a for-loop a while –loop and recursion

Write a function on_all that applies a function to every element of a list. Use it to print the first twenty perfect squaras.

Write a function that concatenates two list.

Write a function that merges two sorted lishts into a new list.

Write a function that computesw the list of the first 100 Fibonacci numbers.

Write a function that takes a number and returns a list of its digits.

Write a function that transliterated a text to pig  Latin and back. English is translated to Pig Latin by taking the first letter ofo every word, moving it to the end of the word and adding ‘ay’ . “The quick brown fox” becomes “Hetay uickqay rownbay oxfay”.