C C++ Java Data Structure Python JavaScript CSS Ajax PL/SQL PHP Puzzles C programs C++ programs Java programs



Home » C programs

C language String solved Programs/Examples






String is the set of characters which is declared as character array, in this section you will find solved programs/examples on C language string with output and explanation.

Most of the program will have user defined functions, in some cases we may use library functions.

  1. C program to read time in string format and extract hours, minutes and second also check time validity.
    In this C program, we are going to read time in string forma (the specified time format will be HH:MM:SS) and program will extract the hours, minutes and seconds also checking time validity.
  2. C program to swap adjacent characters of a string.
    In this C program, we are going to learn how to swap adjacent characters of a string? Here, we will have a string with even number of characters (string length must be even to swap the adjacent characters).
  3. C program to eliminate all vowels from a string.
    In this C program, we are going to learn how to eliminate all vowels from a given string? Here, we have a string that may contain consonants, vowels etc we have to remove only vowels from it.
  4. C program to remove alphabets from an alphanumeric string.
    In this C program, we are going to learn how to remove alphabets from a given alphanumeric string? If string contains alphabets and numbers both, this program will remove only alphabets from the string.
  5. C program to convert a string to sentence case.
    In this C program, we are going to learn how to convert a given string to sentence case. To implement this logic, we are creating a user define function to do the same.
  6. C program to remove all spaces from a given string.
    In this C program, we are going to learn how to remove all spaces from a given string? Here, we will have a string with spaces and program will remove all spaces and print the string without spaces.
  7. C program to copy one string to another and count copied characters.
    In this C program, we are going to learn how to copy one string to another without using any library function? Here, we will also get the total number of copied characters and printing them.
  8. C program to read n strings and print each string's length.
    In this article, we will read n strings from the input and store it in array and print the length of each string in the array.
  9. C program to eliminate/remove first character of each word from a string.
    This string program will read a string from the user and eliminate/remove first character of each word of input string in C programming language.
  10. C program to eliminate/remove all vowels from a string.
    This string program will read a string and eliminate/remove all vowels from input string.
  11. C program to read a string and print the length of the each word.
    This program will read a string and print the length of each word, for example, if input is “Hi there how are you?” then output will be 2, 5, 3, 3, 4.
  12. C program to find the frequency of a character in a string.
    This program will read a string and character to find it frequency and print frequency of given character in input string.
  13. C program to capitalize first character of each word in a string.
    This program will read a string and print in Capitalize form where first character of each word will be capital (uppercase) and other characters will be small (lowercase).
  14. C program to create and print array of strings.
    This program will create, read and print an array of string in C programming language.
  15. C program to compare two strings using pointers.
    This program will read two strings and compare them character by character using pointers in C programming language.
  16. C program to print indexes of a particular character in a string.
    This program will read a string and a character to find its indexes where character exists in C programming language.







You may also be interested in...

C/C++ Tips and Tricks...

Was this page helpful? YES NO

Are you a blogger? Join our Blogging forum.


Comments and Discussions