Question: c programming Write a program that can find the length of a string, find the number of words, copy a string, and capitalize the copied

 c programming Write a program that can find the length of

c programming

Write a program that can find the length of a string, find the number of words, copy a string, and capitalize the copied string. Your program will not take any arguments. Instead, we will pass in the string using a built- in function called gets int main(int argc, char **argv) char string[ 100]; char string2[1001 // get the input string printf("Enter string: gets (string): gets will take a line of input from the user and the resulting characters will be put in the string array You can find the number of words by counting spaces. You can check if a character is a space by checking if it is equal to 0x20 (the ASCII code for space) or comparing it with You will need to handle the case where the user pet multiple spaces between words. That should not count as multiple words. For the string copy, copy the characters from the original string and put it into string2. Make sure you terminate the new string2with a 0 The program results should look like: s./string Enter string: This is my string The length of the string is 17 The number of words is 4 The capitalized string is THIS IS MY STRING The original string is This is my string Make sure you print the original string after the capitalized string, so that you know the string copy worked

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!