0% found this document useful (0 votes)
5 views6 pages

String Programs in C

The document provides an extensive list of C programming examples focused on string manipulation, including operations, functions, and algorithms. It covers various topics such as palindrome checking, string matching, cryptography, and character frequency analysis, with each example accompanied by a description, code, and output. The examples are designed to be compiled and tested on both Windows and Linux systems.

Uploaded by

Sudha Kore
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views6 pages

String Programs in C

The document provides an extensive list of C programming examples focused on string manipulation, including operations, functions, and algorithms. It covers various topics such as palindrome checking, string matching, cryptography, and character frequency analysis, with each example accompanied by a description, code, and output. The examples are designed to be compiled and tested on both Windows and Linux systems.

Uploaded by

Sudha Kore
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

[Link]

com/c-programming-examples-strings/

String Programs in C

In C programming, a string is a one-dimensional array of characters that ends


with the special character ‘\0’. Character arrays or strings are used to
manipulate text, such as words or sentences. In strings, the termination
character (‘\0’) is very important because it is the only way to detect where the
string ends. Strings can be written as character arrays or string literals in the C
language. The most commonly used string functions are strlen(), strcmp(),
strcpy(), strchr(), and strcat().

The following section contains various C programs related to strings, string


operations, string functions, palindrome programs, string programs using
recursion, frequency, and occurrence of characters in a string. C programs on
string matching, approximate string matching, and encryption algorithms are
also covered with examples. Each sample program on the linked list includes a
program description, C code, and program output. All examples have been
compiled and tested on Windows and Linux systems.

Here is the listing of C programming examples on Strings:


1. C Programs on Palindome
2. C Programs on String Operations
3. C Programs on String Functions
4. C Programs on Strings
5. C Programs on Frequency of Characters in a String
6. C Programs on Count Occurrences of a Character in a String
7. C Programs on String using Recursion
8. C Programs on String Matching
9. C Programs on Cryptography
10. C Programs on Longest Common SubString/SubSequence
1. C Programs on Palindome

Program Description

String Palindrome Program in C C Program to Check if a Given String is Palindrome

C Program to Check whether a String is Palindrome or not using


Palindrome String using Recursion in C
Recursion

C Program to Check if a String is a Palindrome without using


Palindrome String without Built-in Function in C
Built-in Function

C Program to Find Smallest and Biggest Possible Word which is


Smallest and Largest Palindrome in C
Palindrome in a String
advertisement
2. C Programs on String Operations
[Link]

Program Description

String Concatenation in C C Program to Concatenate Two Strings

Concatenate Two Strings Lexically in C C Program to Concatenate Two Strings Lexically

Compare Two Strings in C C program to Compare Two Strings

C Program to Check if the Substring is Present in the Given


Find Substring in a String in C
String

C Program to Find the Length of a String Without using Built-in


Length of a String without Built-in Function in C
Function

C Program to Insert Character/Word in Any Desired Location in


Insert Character in String in C
a String

Remove Duplicate Words from String in C C Program to Delete All Repeated Words in String
3. C Programs on String Functions

Program Description

Remove Word from String in C C Program to Remove Given Word from a String

Remove Characters in Second String which are C Program to Remove Characters in Second String which are
present in First String in C present in First String

Replace all Characters by Lowercase in C C Program to Replace All Characters by Lowercase

Capitalize First Letter of Each Word in a


C Program to Capitalize First Letter of Each Word in String
String in C

Reverse Each Word in a String in C C Program to Reverse Each Word in a String

Regular Expression Matching in C C Program to Implement Regular Expression Matching

strpbrk() Function in C C Program to Implement strpbrk() Function

4. C Programs on Strings

Program Description
[Link]

Sum of Numbers in String in C C Program to Read a String and Find the Sum of all Digits in the String

Largest and Smallest Word in a String


Program to Find the Largest and Smallest Word in a String
in C

Maximum Occurring Character in a


C Program to Find the Most and Least Repeated Character in the String
String in C

Words Ending with Letter S in C C Program to Print the Words Ending with Letter S

Permutation of a String in C C Program to Print All Permutations of a Given String

List All Lines Containing a given


C Program to List All Lines Containing a Given String
String in C

Check if Two Strings are Permutation


C Program to Check if Two Strings are Permutation of Each Other
of Each Other in C

Anagram Program in C C Program to Check whether Two Strings are Anagrams

Find Position of 1-bits in C C Program to Find the Position of 1-bits

ASCII Value of a String in C C Program to Print Ascii Value of All Characters in the String

Sum of ASCII Value of a String in C C Program to Find the Sum of ASCII Value of All Characters in the String

C Program to Display All Characters Present in the Prime Position of a


Prime String Program in C
String

C Program to Display All


C Program to Print All Possible Combination of Two Words from the
Combinations of Two Words from
String without any Repetition
String without Repeated Combinations

Print Common Characters of Two C Program to Check Whether All Characters in First String is Present in
Strings in C Second String

Square String in C C Program to Print the Square of all the Numbers in a String

Binary Addition of Strings in C C Program to Add Two Binary Strings

Add Two Binary Strings in C C Program to Input 2 Binary Strings and Print their Binary Sum

Convert Integer to String and Vice-


C Program to Convert Integer to String and Vice-versa
versa in C

Grep, Egrep and Fgrep in C C Program to Implement Grep, Egrep and Fgrep Commands
5. C Programs on Frequency of Characters in a String
[Link]

Program Description

Highest Frequency Character in a


C Program to Find Highest Frequency Character in a String
String in C

Frequency of Each Word in a String


C Program to Find the Frequency of Each Word in a String
in C

Frequency of “the” Word in a String


C Program to Find the Frequency of “the” Word in a String
in C

Frequency of a Substring in a String


C Program to Find the Frequency of a Substring in a String
in C

Find Frequency of Characters in a


C Program to Find Frequency and Position of Characters in a String
String in C

Count Repeated Words from a String


C Program to Count Repeated Words from a String
in C

Find all Subsets of a String in C C Program to Find All Possible Subsets of a String

Find all Subsets of given Length in


C Program to Find All Possible Subsets of Given Length in String
String in C
6. C Programs on Count Occurrences of a Character in
a String

Program Description

First and Last Occurrence of Character


C Program to Find First and Last Occurrence of Character in a String
in a String in C

Find Consecutive Occurrence of


C Program to Find Consecutive Occurrence of Vowel in a String
Vowel in a String in C

Find all Occurrences of a Substring in


C Program to Count the Occurrence of a Substring in String
String in C

Count Particular Repeated Word in


C Program to Count Particular Repeated Word in a String
String in C

Count Occurrence of Each Character in


C Program to Count the Occurrence of Each Character in String
String in C

Count Number of Words from a String


C Program to Count Number of Words in a String
in C
[Link]

Count Unique Words from a String in


C Program to Count Number of Unique Words in a String
C
7. C Programs on String using Recursion

Program Description

First Uppercase Letter in a String using


C Program to Find the First Capital Letter in a String using Recursion
Recursion in C

First Uppercase Letter in a String


C Program to Find the First Capital Letter in a String without Recursion
without Recursion in C

String Length using Recursion in C C Program to Find the Length of the String

String Copy using Recursion in C C Program to Copy One String to Another using Recursion

Reverse a String using Recursion in C C Program to Reverse a String using Recursion

Reverse a String using Recursion and


C Program to Reverse a String using Recursion and Iteration
Iteration in C
8. C Programs on String Matching

Program Description

Naive String Matching in C C Program to Perform Naive String Matching

Knuth Morris Pratt Algorithm in C for C Program to Implement Knuth-Morris-Pratt Algorithm for Pattern
Pattern Searching Searching

Knuth Morris Pratt Algorithm in C C Program to Implement KMP Pattern Searching Algorithm

Boyer Moore Algorithm in C C Program to Implement Boyer-Moore Algorithm for Pattern Searching

Rabin Karp String Matching Algorithm


C Program to Implement Rabin-Karp Method for Pattern Searching
in C

Online String Matching using Wagner C Program to Implement Wagner and Fischer Algorithm for Online
and Fisher in C String Matching

Levenshtein Distance Computing


C Program to Implement Levenshtein Distance Computing Algorithm
Algorithm in C

String Matching Using Library in C C Program to Perform String Matching Using String Library

String Search Algorithm in C C Program to Implement String Search Algorithm for Short Text Sizes
[Link]

Repeated Search Pattern in C C Program to Repeatedly Search the Same Text


9. C Programs on Cryptography

Program Description

Monoalphabetic Cipher in C C Program to Implement the Monoalphabetic Cipher

Caesar Cipher in C C Program to Implement Caesar Cipher

Vigenere Cipher in C C Program to Implement the Vigenere Cipher

Hill Cipher in C C Program to Implement the Hill Cipher

Affine Cipher in C C Program to Implement Affine Cipher

Playfair Cipher Encryption Program


C Program to Encrypt Message using Playfair Cipher
in C

RSA Algorithm in C C Program to Implement the RSA Algorithm

Transposition Technique Program in


C Program to Perform Cryptography using Transposition Technique
C

Checksum Program in C C Program to Implement the Checksum Method for Small String Messages
10. C Programs on Longest Common
SubString/SubSequence

Program Description

Longest Repeating Subsequence in C C Program to Find Longer Repeating Sequence

Length of Longest Repeating


C Program to Find the Length of Longest Repeating Subsequence
Subsequence in C

Longest Increasing Subsequence in C C Program to Find the Longest Increasing Subsequence

You might also like