Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C language 1. Finish writing this program that finds the length of a string. Do not use the builtin strlen function. #include int main(int

In C language

image text in transcribed

1. Finish writing this program that finds the length of a string. Do not use the builtin strlen function. #include int main(int argc, char **argv) char *input = argv[1]; int length; printf ("The length of the string is %d ", length); When run, you should get: $./a.out "This is a really long string" The length of the string is 28 2. Add some code to the above code so that it counts the number of h's in the string. You should be able to count both upper case and lower case h's. You will need to loop over the string, and whenever you find a 'h' increment your count. When run, you should get: $./charcount "Hello World" The length of the string is 11 There is ih in the string $./charcount "Hello there" The length of the string is 11 There are 2 h's in the string Note the difference in the output depending on if there is one 'h' or more than one 'h' in the string

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Embodiment.

Answered: 1 week ago

Question

the pourpose of poster's five forces analysis is to

Answered: 1 week ago

Question

Does it avoid using personal pronouns (such as I and me)?

Answered: 1 week ago

Question

Does it clearly identify what you have done and accomplished?

Answered: 1 week ago