
Assignment 6: String
1) Without using inbuilt string functions, perform the following in C language:
a) copy one string into another
b) compare two strings
c) concat two strings
d) reverse a given string
2) Write a program to print the equivalent ASCII code of the string entered by the user.
3) Write a program to sort a given string in alphabetical order.
4) Perform the following in C language:
For two strings given by the user, merge them and print the third-string in the following
manner:
Input: String1: FCP String2: subject
Output string: FCP subject
5) Write a program to count all occurrences of a particular word from a given string.
6) Write a program in C to replace a particular word by another word from a given string.
Extended
1. Write a program in C to find the maximum occurring character in a string.
2. Write a C program to check whether a given substring is present in the given string.
3. Write a program in C to remove only digits from the string if any(exclude
alphabets).
4. Write a program in C to find the largest and smallest word in a string.
5. Write a program in C to read a file and remove the spaces between two words of its
content.
6. Write a program in C to count the total number of alphabets, digits and special
characters in a string.