Question
Write a C program that reads a special string from the standard input and display its length. The special string does not contain any consecutively
Write a C program that reads a special string from the standard input and display its length. The special string does not contain any consecutively repeated characters. For example a C string that contains the phrase LIKE is represented as L I K E \0. Since our string doesnt contain any consecutively repeated characters, we repeat the last character to terminate the string, so the above string is represented as L I K E E, where the second E terminates the string (and is not a part of the string). Here are few strings to represent few phrases. The maximum length of the string is 50 characters.
Your program should read one line of text and display its length as a left justified integer (just %d) followed by a new line character.
String Representation Output Hi there This test is easy I am free today Hi theree This test is easyy Could not be represented because there are two consecutive 'e's in the string 17 I am busy Friday morningI am busy Friday morningg 24 (space is a part of the stringStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started