Practice: C Strings


  1. Create a string one that can hold up to 30 characters.
  2. Create a string two that can hold up to 10 characters and initialize it to "purple".
  3. Create a string three that can hold up to 10 characters and initialize it to "yellow".
  4. Print two and three.
  5. Capitalize the first letter of two and three and print again.
  6. Prompt the user and read a line into one.
  7. Print one.
  8. Prompt the user and read a char (use %c).
  9. Print the number of times this char is found in one.
  10. Print the first word of one. If the is only one word then print the whole string.


Email Me | Office Hours | My Home Page | Department Home | MCC Home Page

© Copyright Emmi Schatz 2021