Home
Aptitude
Categories


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.

List of string programs in C

  1. 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.
  2. 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.
  3. C program to create and print array of strings.
    This program will create, read and print an array of string in C programming language.
  4. 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).
  5. 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.
  6. 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.
  7. 


  8. 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.
  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 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.
  11. 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.
  12. 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.
  13. 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.
  14. 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.
  15. 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.
  16. 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).
  17. 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.
  18. Creating string buffer (character pointer), allocating memory at run time in C.
    Here, we are going to learn how to create a character pointer (string buffer), how to declare memory at run time in C language?
  19. memcpy() function in C with Example.
    string.h – memcpy() function with example: Here, we are going to learn about the memcpy() function – which is used to copy a block of memory from one location to another .
  20. Write your own memcpy() function in C.
    Here, we are going to learn how to write your own memcpy() function to copy blocks of memory from one location to another?
  21. memset() function in C with Example.
    string.h memset() function with example: Here, we are going to learn about the memset() function of string.h in C/C++ language, which is used to fill a block of memory with the given value.
  22. Write your own memset() function in C.
    Here, we are going to learn how to write your own memset() function to fill blocks of memory with a particular value in C?






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.