data structures using writing strings strings can be displayed on the screen using the following three ways using printf(function using puts(functionand using putchar(function repeatedly strings can be displayed using printf(by writing printf("% "str)we use the format specifier % to output string observe carefully that there is no '&character used with the string variable we may also use width and precision specifications along with % the width specifies the minimum output field width if the string is shortthe extra space is either left padded or right padded negative width left pads short string rather than the default right justification the precision specifies the maximum number of characters to be displayedafter which the string is truncated for exampleprintf ("% "str)the above statement would print only the first three characters in total field of five characters also these characters would be right justified in the allocated width to make the string left justifiedwe must use minus sign for exampleprintf ("%- "str)note when the field width is less than the length of the stringthe entire string will be printed if the number of characters to be printed is specified as zerothen nothing is printed on the screen the next method of writing string is by using puts(function string can be displayed by writing puts(str)puts(is simple function that overcomes the drawbacks of the printf(function strings can also be written by calling the putchar(function repeatedly to print sequence of single characters = while(str[ !'\ 'putchar(str[ ]);/print the character on the screen ++ operations on strings in this sectionwe will learn about different operations that can be performed on strings step [initializeset step repeat step while str[ !null step set [end of loopstep set length step end figure algorithm to calculate the length of string finding length of string the number of characters in string constitutes the length of the string for examplelength(" programming is fun"will return note that even blank spaces are counted as characters in the string figure shows an algorithm that calculates the length of string in this algorithmi is used as an index for traversing string str to traverse each and every character of strwe increment the value of