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

  1. C Program to take string as an input
  2. C Program to find length of a string
  3. C Program to copy one string to another string
  4. C Program to concatenate two strings
  5. C Program to convert lowercase string to uppercase
  6. C Program to convert uppercase string to lowercase
  7. C Program to toggle case of a string
  8. C Program to count alphabets, digits and special characters in a string
  9. C Program to count number of vowels and consonants in a string