From the course: Complete Guide to C Programming Foundations

Unlock the full course today

Join today to access over 24,300 courses taught by industry experts.

Chapter challenge: Reading commands

Chapter challenge: Reading commands - C Tutorial

From the course: Complete Guide to C Programming Foundations

Chapter challenge: Reading commands

(bright music) - [Instructor] This chapter's challenge is similar to an earlier chapter challenge, but now you can perform full string manipulation. Again, you see a while loop. This one is endless. Inside the loop is a command prompt. Comments explain what you need to code. First come any variable declarations, within the loop, fetch input from the user, a string, modify the string to remove the new line, convert the string to uppercase, output the command the user typed. If the command is the word quit, break the loop. Here's a sample run of the final code to show you what's needed. You can type any command, say "GIGGLE," and the computer just outputs the text, processing the command and whatever you typed in uppercase. The program repeats it no matter what. (keyboard clicks) And of course, if you need to quit, type the word quit and quit is obeyed. It's listened to. The program quits. Your task is to complete the code, fetch user input, remove the new line, and convert the input…

Contents