String Traversal implementation in C
Strings are a collection of characters followed by a ‘null’ character. ’Null’ is represented by ‘\0’. In C, string is considered as character array Syntax: To declare a string: ‘char string_name[]; To assign a value: ‘string_name[]’ = “value”; ‘value’ may be a string or set of characters as follows. a[]= “Sample”; a[15] = {‘S’,’a’,’m’,’p’,’l’,’e’,’\0’}; How to get the input and print the output? There are some built-in functions to read and write the string. ‘printf()’,’puts()’ -To print the output. ‘scanf()’,’gets()’- To get the input from the user. ‘fgets()’ – it is used to get the input from file. Built-in functions to perform String operations: ‘strlen(string)’ – it gives you the length of the string. ‘strcpy(destination, source) – It Copies source data into destination. ‘strcat(dest, src)’ – it helps in concatenation of two strings. ‘strcmp(str1, str2)’ - it Compares two strings. It returns 0 if equal, otherwise it is 1...