C Programs list
Here’s a list of common programs you can write in C language to practice and strengthen your understanding of various concepts like loops, arrays, functions, pointers, etc.:
Basic Programs
- Hello World Program: Print "Hello, World!".
- Addition of Two Numbers: Add two numbers entered by the user.
- Simple Calculator: Perform basic arithmetic operations (+, -, *, /).
- Odd or Even Program: Check if a number is odd or even.
- Find Maximum of Three Numbers: Determine the largest of three numbers.
- Swap Two Numbers: Swap two numbers using a third variable and without using a third variable.
- Reverse a Number: Reverse the digits of an integer number.
- Palindrome Number: Check if a number is a palindrome.
- Fibonacci Series: Generate the Fibonacci sequence up to a certain number.
- Factorial Program: Calculate the factorial of a number using recursion and iteration.
Control Structures and Loops
- Prime Number Check: Check if a number is prime or not.
- Prime Numbers Between Two Intervals: Print all prime numbers in a given range.
- Leap Year Check: Determine if a year is a leap year or not.
- Armstrong Number: Check if a number is an Armstrong number (e.g., 153 = 1³ + 5³ + 3³).
- Sum of Digits: Find the sum of the digits of an integer.
- LCM and GCD of Two Numbers: Calculate the Least Common Multiple (LCM) and Greatest Common Divisor (GCD).
- Number Pattern Program: Print patterns like triangles or squares using numbers.
- Alphabet Pattern Program: Print patterns using alphabets.
- Pyramid Pattern Program: Print star-based pyramid patterns.
Array Programs
- Array Sum: Calculate the sum of elements in an array.
- Array Reversal: Reverse the elements of an array.
- Find Maximum and Minimum in Array: Find the largest and smallest elements in an array.
- Sorting an Array: Sort an array using the bubble sort, selection sort, or insertion sort algorithms.
- Matrix Addition: Add two matrices.
- Matrix Multiplication: Multiply two matrices.
- Transpose of a Matrix: Find the transpose of a matrix.
- Linear Search: Implement linear search in an array.
- Binary Search: Implement binary search in a sorted array.
String Programs
- String Reversal: Reverse a string.
- Palindrome String: Check if a string is a palindrome.
- String Length: Find the length of a string using
strlen()
or manually. - String Copy: Copy one string to another without using
strcpy()
. - String Concatenation: Concatenate two strings without using
strcat()
. - Count Vowels and Consonants: Count the number of vowels and consonants in a string.
- Remove Duplicates from String: Remove duplicate characters from a string.
- Find Substring: Check if a substring exists in a given string.
Functions and Recursion
- Factorial Using Recursion: Calculate the factorial of a number using recursion.
- Fibonacci Series Using Recursion: Generate the Fibonacci sequence using recursion.
- Sum of Digits Using Recursion: Find the sum of digits of a number using recursion.
- GCD Using Recursion: Calculate the GCD of two numbers using recursion.
- Tower of Hanoi: Solve the Tower of Hanoi problem using recursion.
Pointer Programs
- Pointer Basics: Print the address and value of a variable using a pointer.
- Pointer Arithmetic: Perform pointer arithmetic (increment/decrement).
- Swap Two Numbers Using Pointers: Swap two numbers using pointers.
- Array and Pointer Relationship: Traverse and manipulate an array using pointers.
- Pointer to Function: Demonstrate the use of pointers to functions.
File Handling Programs
- File Read/Write: Write a program to read from and write to a text file.
- Copy Contents of One File to Another: Copy contents from one file to another.
- Count Words in a File: Count the number of words in a text file.
- Append Data to File: Append content to an existing file.
- Delete a File: Write a program to delete a file.
Advanced Programs
- Tic-Tac-Toe Game: Create a simple console-based Tic-Tac-Toe game.
- Simple Banking System: Implement a simple banking system with deposit, withdrawal, and balance check functionalities.
- Student Record Management System: Build a system to manage student records using structures and file handling.
- Singly Linked List: Implement a singly linked list and perform basic operations (insert, delete, traverse).
- Doubly Linked List: Implement a doubly linked list and perform operations.
- Stack Using Array: Implement a stack using an array.
- Queue Using Array: Implement a queue using an array.
- Circular Queue: Implement a circular queue using an array.
- Binary Search Tree: Implement a binary search tree with insertion, deletion, and traversal operations.
These programs range from beginner to intermediate and cover various important concepts in the C language. As you practice these, you'll develop a solid foundation in C programming.