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

  1. Hello World Program: Print "Hello, World!".
  2. Addition of Two Numbers: Add two numbers entered by the user.
  3. Simple Calculator: Perform basic arithmetic operations (+, -, *, /).
  4. Odd or Even Program: Check if a number is odd or even.
  5. Find Maximum of Three Numbers: Determine the largest of three numbers.
  6. Swap Two Numbers: Swap two numbers using a third variable and without using a third variable.
  7. Reverse a Number: Reverse the digits of an integer number.
  8. Palindrome Number: Check if a number is a palindrome.
  9. Fibonacci Series: Generate the Fibonacci sequence up to a certain number.
  10. Factorial Program: Calculate the factorial of a number using recursion and iteration.

Control Structures and Loops

  1. Prime Number Check: Check if a number is prime or not.
  2. Prime Numbers Between Two Intervals: Print all prime numbers in a given range.
  3. Leap Year Check: Determine if a year is a leap year or not.
  4. Armstrong Number: Check if a number is an Armstrong number (e.g., 153 = 1³ + 5³ + 3³).
  5. Sum of Digits: Find the sum of the digits of an integer.
  6. LCM and GCD of Two Numbers: Calculate the Least Common Multiple (LCM) and Greatest Common Divisor (GCD).
  7. Number Pattern Program: Print patterns like triangles or squares using numbers.
  8. Alphabet Pattern Program: Print patterns using alphabets.
  9. Pyramid Pattern Program: Print star-based pyramid patterns.

Array Programs

  1. Array Sum: Calculate the sum of elements in an array.
  2. Array Reversal: Reverse the elements of an array.
  3. Find Maximum and Minimum in Array: Find the largest and smallest elements in an array.
  4. Sorting an Array: Sort an array using the bubble sort, selection sort, or insertion sort algorithms.
  5. Matrix Addition: Add two matrices.
  6. Matrix Multiplication: Multiply two matrices.
  7. Transpose of a Matrix: Find the transpose of a matrix.
  8. Linear Search: Implement linear search in an array.
  9. Binary Search: Implement binary search in a sorted array.

String Programs

  1. String Reversal: Reverse a string.
  2. Palindrome String: Check if a string is a palindrome.
  3. String Length: Find the length of a string using strlen() or manually.
  4. String Copy: Copy one string to another without using strcpy().
  5. String Concatenation: Concatenate two strings without using strcat().
  6. Count Vowels and Consonants: Count the number of vowels and consonants in a string.
  7. Remove Duplicates from String: Remove duplicate characters from a string.
  8. Find Substring: Check if a substring exists in a given string.

Functions and Recursion

  1. Factorial Using Recursion: Calculate the factorial of a number using recursion.
  2. Fibonacci Series Using Recursion: Generate the Fibonacci sequence using recursion.
  3. Sum of Digits Using Recursion: Find the sum of digits of a number using recursion.
  4. GCD Using Recursion: Calculate the GCD of two numbers using recursion.
  5. Tower of Hanoi: Solve the Tower of Hanoi problem using recursion.

Pointer Programs

  1. Pointer Basics: Print the address and value of a variable using a pointer.
  2. Pointer Arithmetic: Perform pointer arithmetic (increment/decrement).
  3. Swap Two Numbers Using Pointers: Swap two numbers using pointers.
  4. Array and Pointer Relationship: Traverse and manipulate an array using pointers.
  5. Pointer to Function: Demonstrate the use of pointers to functions.

File Handling Programs

  1. File Read/Write: Write a program to read from and write to a text file.
  2. Copy Contents of One File to Another: Copy contents from one file to another.
  3. Count Words in a File: Count the number of words in a text file.
  4. Append Data to File: Append content to an existing file.
  5. Delete a File: Write a program to delete a file.

Advanced Programs

  1. Tic-Tac-Toe Game: Create a simple console-based Tic-Tac-Toe game.
  2. Simple Banking System: Implement a simple banking system with deposit, withdrawal, and balance check functionalities.
  3. Student Record Management System: Build a system to manage student records using structures and file handling.
  4. Singly Linked List: Implement a singly linked list and perform basic operations (insert, delete, traverse).
  5. Doubly Linked List: Implement a doubly linked list and perform operations.
  6. Stack Using Array: Implement a stack using an array.
  7. Queue Using Array: Implement a queue using an array.
  8. Circular Queue: Implement a circular queue using an array.
  9. 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.