Research Code
Research Code
Objectives:
To understand the use standard library functions for string operations. To perform
the string operations.
Input: One or Two Strings
Theory :
String:
Null-terminated String:
String is terminated by a special character which is called as null terminator or
null parameter (\0). So when you define a string you should be sure to have
sufficient space for the null terminator. The null terminator has value 0.
Declaring String:
As in string definition, we have two ways to declare a string. The first way
is, we declare an array of characters as follows:
char s[] = “string”
or
char str[20];
Algorithms:
Conclusion:
By this way, we can perform string operations successfully.
Questions:
1. Write a program to find the length of string.
2. Write a program to display string from backward.
3. Write a program to count number of words in string.
4. Write a program to concatenate one string contents to another.
5. Write a program to compare two strings they are exact equal or not.
6. Write a program to check a string is palindrome or not.
7. WAP to find a substring within a string. If found display its starting position.
8. Write a program to reverse a string.
9. Write a program to convert a string in lowercase.
10. Write a program to convert a string in uppercase.