C PROGRAMS

Here more than 100 basic c programs are listed for practice. I have divided these c programs according to the topics for easier navigation and understanding.

Request : Please Link to this post and share this on social networking sites if you find it useful.

CONTENTS

Back to contents
  1. A simple program for printing a line of text
  2. Program to input integer number and display it
  3. Program to add, subtract, multiply and divide two numbers
  4. Program to subtract two numbers without using arithmetic operator ( - )
  5. Program to find greatest between three numbers using conditional operator ( ? : )
  6. Program to find the average of three numbers with input values as integer and output value (avg) as float
  7. Program to find the area of a right angled triangle based on base and height values
  8. Program to find or obtain the sum of square of two floating point numbers
  9. Program to find the simple interest an total amount based on interest
  10. Program to enter 10 digit number and displaying it in the given format where first 3 digit refer to area code, next three digit to exchange code and remaining to number
  11. Program to input a number and find whether it is even or odd
  12. Program to find biggest of four no by using ternary operator
  13. Program to print smallest of four no by using ternary operators
  14. Program to accept a year and check the given year is leap or not by using ternary operator 
  15. Program to find area of a triangle when there sides are given

CONTROL STRUCTURES

Back to contents
  1. Program to multiply 2 number without using * operator
  2. Program to determine Armstrong number
  3. Program to input time in seconds and convert them into hours and seconds and display it
  4. Program to determine Palindrome number
  5. Program showing the use of 'goto' statement
  6. Program for finding the factorial of a number
  7. Program to find whether the entered character is vowel or not using if else
  8. Program to find whether the entered character is vowel or not using switch case
  9. Program to print the table of a given number till the user wishes
  10. Program to sum up all the integer numbers input at run time until zero is entered
  11. Program to find whether a given number is Prime or Not
  12. Program to print ( list ) all the prime number between 1 to n
  13. Program to print (list) Palindrome number from 10 to n
  14. Program to print (list) Armstrong Number between two given numbers
  15. Program to print the factor of a given number
  16. Program to print the fibonacii series till which user wishes
  17. Program to determine whether entered character is capital case letter, small case letter, a digit or a special symbol
  18. Program to find whether a number is Perfect Square or Not
  19. Program to print (list) Perfect Square Number between any two number
  20. Program for Bank account Handling
  21. Program to award Grades
  22. Grade Program without using if-else statement
  23. Program to calculate the sum of individual digits of a number
  24. Program to determine whether a given year is leap year or not
  25. Program to encode and decode ( cipher )

PATTERNS

Back to contents
  1. Program to print the given pattern :
    *
    * *
    * * *
    * * * *
    * * * * * 
  2. Program to print the given pattern :
    *
    * *
    * * *
    * * * *
    * * * * *
    * * * * * * ..... till n rows
  3. Program to print the given pattern :
    1
    1 2
    1 2 3
    1 2 3 4
    1 2 3 4 5 .... till n rows
  4. Program to print the given pattern :
    1
    2 2
    3 3 3
    4 4 4 4
    5 5 5 5 5 .... till n rows
  5. Program to print the given pattern :
    1 1 1 1 1
    2 2 2 2 2
    3 3 3 3 3
    4 4 4 4 4
    5 5 5 5 5
  6. Program to print the given pattern :
    5
    5 4
    5 4 3
    5 4 3 2
    5 4 3 2 1
  7. Program to print the given pattern :
    1 2 3 4 5
    1 2 3 4
    1 2 3
    1 2
    1
  8. Program to print the given pattern :
    5 4 3 2 1
    5 4 3 2
    5 4 3
    5 4
    5
  9. Program to print the given pattern :
            *
          * *
        * * *
      * * * *
    * * * * *
    
  10. Program to print the given pattern :
            1
          1 2
        1 2 3
      1 2 3 4
    1 2 3 4 5
  11. Program to print the given pattern :
            5
          4 5
        3 4 5
      2 3 4 5
    1 2 3 4 5
    
  12. Program to print the given pattern :
    1
    * *
    1 2 3
    * * * *
    1 2 3 4 5 .... till n rows
  13. Program to print the given pattern :
    1                 1
    1 2             1 2
    1 2 3         1 2 3
    1 2 3 4     1 2 3 4
    1 2 3 4 5 1 2 3 4 5
    
  14. Program to print the given pattern :
    1                 1
    1 2             2 1
    1 2 3         3 2 1
    1 2 3 4     4 3 2 1
    1 2 3 4 5 5 4 3 2 1
    
  15. Program to print the given pattern :
    1                 5
    1 2             5 4
    1 2 3         5 4 3
    1 2 3 4     5 4 3 2
    1 2 3 4 5 5 4 3 2 1
    
  16. Program to print the given pattern :
    1
    2 6
    3 7 10
    4 8 11 13
    5 9 12 14 15 ... till n rows
  17. Program to print the given pattern :
    ******** ********
    *******   *******
    ******     ****** 
    *****       *****
    ****         ****
    ***           ***
    **             **
    *               *
     
    *               *
    **             **
    ***           ***
    ****         ****
    *****       ***** 
    ******     ******
    *******   *******
    ******** ********
    

  18. Program to print the given pattern
     
          *
         ***
        *****
       *******
      *********
       *******  
        *****
         ***
          * 
    
  19. Program to print the given pattern :
    8 4 2 1
    4 2 1
    2 1
    1
  20. Program to print Pascal triangle :

FUNCTIONS

Back to contents
  1. Program to find sum of two numbers using function sum(int,int) that returns sum value
  2. Program to print the area of a rectangle
  3. Program to find the factorial of two numbers and add them and print the result
  4. Program to implement functions that returns HCF OR GCD and LCM of two numbers
  5. Write a function that receives a positive integer as input and returns the leading digit in its decimal representation
  6. Implement a function that receives an integer value and returns the number of prime factors of that number. If the number is itself a prime number then return 0
  7. Program to find maximum number between three numbers
  8. Program to accept a number and print the sum of given and Reverse number using function

RECURSION

Back to contents
  1. Program to accept elements in an array and display it
  2. Program to accept elements in an array and display sum of all the elements
  3. Program to insert element in between an array. ( INSERTION )
  4. Program to delete element from an array. ( DELETION )
  5. Program to perform Transpose of a Matrix
  6. Program to find Minimum element in an array
  7. Program to find highest minimum temperature and lowest maximum temperature
  8. Program to accept 10 numbers and print first five numbers in original order and print last five numbers in reverse order
  9. Program showing Passing array to function. Program finds the average of 5 marks input by user
  10. Program to initialize a character array and display the initialized character array in reverse order
  11. Program to generate histogram of entered number
  12. Program to enter values into a two-dimensional integer array of size (4 X 3) and then display it in matrix form
  13. Write a program to enter values into a two-dimensional integer array of size (4 X 3) and then display the elements of the second row
  14. Program to find the sum of elements that are greater than 5 within a two-dimensional array through a function receiving the array as arguments
  15. Program To Accept 5 Student - Roll No, Marks in 3 Subjects of each student and Calculate Total, Average and Print it along with student roll Number
  16. Programs to multiply two Matrices
  17. Program to print a diagonal matrix with diagonal value enter by user
  18. Program to print a anti diagonal matrix with diagonal value enter by user
  19. Program to print the sum of diagonal values and anti-diagonal values of a matrix
  1. Program to accept a string and print it
  2. Program to accept a character in the uppercase and print in lower case
  3. Program to accept a string in Lower case and print it in upper case
  4. Program to accept a character in any case and print in another case
  5. Program to accept a string and print it by using while loop
  6. Program to find length of a string using string function
  7. Program to find length of a string without using string function
  8. Program for Copy a String to another using String Function
  9. Program to find length of a string without using string function
  10. Program for Compare two String using String Function
  11. Program for Compare two String without using String Function
  12. Program for String Reverse with String Function
  13. Program for String Reverse without String Function
  14. Program for String Concatenation with String Function
  15. Program for String Concatenation without String Function
  16. Program to convert all characters in a string to lower case using string function
  17. Program to convert all characters in a string to lower case without using string function
  18. Program to convert all characters in a string to upper case using string function
  19. Program to convert all characters in a string to upper case without using string function
  20. Program to enter 5 string and print them with their length
  21. Program to accept a string and print each word of the string separately also print total number of words
  22. Program to accept a string and display vowels frequency( total number of vowels)
  23. Program to accept a string and display frequency of each vowel along with vowel
  24. Program to enter a word and check whether it is palindrome or not using string function
  25. Program to enter a word and check whether it is palindrome or not without using string function

POINTERS

Back to contents

DYNAMIC MEMORY ALLOCATION

Back to contents

Share this

Related Posts

Previous
Next Post »