Problem Set: C Strings
-
- Create a string that can hold up to 30 characters.
- Prompt the user and read a line into the string.
- Print the string.
- Print the first letter.
- Print the length of the string. DO NOT USE STRLEN.
- Add '!' to the end of the string.
- Print the string with each character on a separate line. (Use %c
in printf to print a character.
- Print the string again.
- Prompt and read two words and print the words in alphabetical order.
- Prompt and read three words and print the words in alphabetical order.
- Write a function with one parm, a string. The function should return
the number of words in the string. You can assume there is only one blank
between words.
- Write the statements to prompt and read a line, call your function from
the previous problem, and print the number of words in the line.
- Write a function to count and return the number of vowels in the
string parameter.
- Write a loop which will prompt and read a line, call your function
from the previous problem, and print the number of vowels. Stop your loop
when the user enters "end".
- Write and test your own version of strlen.
- Write and test your own version of strcpy.
- Write and test your own version of strcat.
Email Me |
Office Hours |
My Home Page |
Department Home |
MCC Home Page
© Copyright Emmi Schatz 2020