Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


C Programming Code Examples

C > Strings Code Examples

Program takes a 'string as input' and finds the sum of 'ASCII values' of all characters in given string. Take a string as "input & store" it in the array string[]. Initialize the variable sum to '0'.


Locates "first occurrence" in string string1 of any character in string string2, If a character from string string2 is found, a pointer to the character in string 'string1' is returned, if not

Program performs a Pattern Searching using "KMP" 'Pattern Searching Algorithm'. Pattern searching is used for Finding the Existence of a Substring in a String. The pattern searching





Print combination of two words of two given strings without any repetition. Incrementing the count if the characters of the main string match with the characters of the given word.


This program takes a string as input and print the words ending with letter "s". Take a string as input and store it in the array str[]. Find its length & add a blank space to the input string

Program takes a String containing both digits and alphabet as input and finds the sum of all digits in the string. Take the string containing both 'digits and alphabet' as input and store it

C program Read two strings and Concatenate them, without using library functions. Display the 'Concatenated String'. Take two strings as input and store them in the arrays string1 and

This program takes a string from the user and stored in the Variable line. The, Within the for loop, each character in the string is checked if it is an alphabet or not. If any character inside


Program to remove all occurrences of a given character from the string using Loop. Enter a character to Remove from string. Function to "Remove all occurrences" of a character from

C program remove all 'occurrences' of a given word in string using loop. Logic to remove all occurrences of a word in a string. Input string from user, store it in some variable say string.

C program to remove all Repeated characters in a String using loops. Input string from user. Remove all duplicate characters from a given string. Remove all occurrences of a character

C program to "read any string" from user and Remove first Occurrence of a given character from the string. The program should also use the concept of functions to remove the given

C program to 'input any string' from user and remove first occurrence of a given word from string. Logic to remove 'first occurrence' of a word. Input string from user, store it in some

This program takes string and its substring as input, removes the Substring from the string. Take a string, its substring as input and Store it in the array str[] & key[] respectively. Store

C program to 'Read any String' from user and Remove Last Occurrence of a given character from the string. Remove last Occurrence of a character from the string. Shift all characters

Remove the 'last occurrence' of any word in a string using Loop in C Language. Input string from user, store it in some variable say string. Input word to be 'searched' from user, store it
C program remove extra spaces, blanks from the string. Removes 'extra blank spaces' from the given string and returns a new string with single "blank spaces" and skip all consecutive
Write a C program to 'Replace all Occurrence' of a character with another in a string using a Function. 'Input a string' from user, store it in some variable say str. Input old character and
C Code replace first occurrence of a character with another in a string. Input the string from user, store it in some variable say 'str'. Input a character to replace, character new character
How to replace last occurrence of a character with another character in a given string using functions in 'C Language'. Input a string from user, store it in some variable say 'str'. Input a
Accepts the sentence and replaces lowercase characters by uppercase and vice-versa. Take an an English sentence as input and store it in the array "sentence[]". Copy the Last Letter's
Program 'takes a string', reverses every word of the string. Take a string as input and store each word of the input string in the separate rows of the '2-D array'. Reverse each word of
In C program, we are going to accept a string. Program will check for word inside string and if word founds then program will reverse that word. Similarly it'll Reverse out all the Words.
Logic to reverse the order of words in a given string. There are many Logic's to Reverse the order of words. Here is the simplest approach I am using to Reverse the order. Input a string
Lets find the length of the string using library function strlen(). A "string" is charracter array and a "Character Array" have character range between 0 to length-1. Thus we have position
Write a C program to 'Search all Occurrences' of a character in a String using Loop. Logic to search occurrences of a character in the given string. Input String from user, store it in some
C program to search all occurrences of a word in given string using loop. Input string & word from user. Run a Loop from 'starting index' of string to Length of string - word length. Enter
Searching whether character is present in the string or not. Accept the String from the user. Accept the character to be searched. String is stored as array of character, "scan each array"
Program to sort set of strings in alphabetical order using strcmp(). Program will accept set of 5 strings & sort them using 'strcmp' library function and "Print the Result" on the screen.
In this program, user would be asked to enter a set of Strings and the program would sort & display them in Ascending alphabetical order. This C program would sort the input strings in
C program which will accept 'multiple strings' from the user and will sort them in ascending order. Checking each successive strings using strcmp() function. If string is greater than the

Page 1 Page 2 Page 3 Page 4 Page 5