C Programs - String
String is the most frequently used data type in any language.
In C language, a string is a sequence of characters terminated with a null character \0
.
String declaration
char str_name[size];
// other example
char str1[] = "pro coding";
char str2[50] = "procoding";
char str3[50];
char str4[] = {'a', 'b', 'c', 'd', '\0'};
char str5[50] = {'a', 'b', 'c', 'd', '\0'};
List of programs
- C Program to take string as an input
- C Program to find length of a string
- C Program to copy one string to another string
- C Program to concatenate two strings
- C Program to convert lowercase string to uppercase
- C Program to convert uppercase string to lowercase
- C Program to toggle case of a string
- C Program to count alphabets, digits and special characters in a string
- C Program to count number of vowels and consonants in a string