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 - 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
-
-
-
-
-
-
-
-
-
Using single character I/O3m 32s
-
(Locked)
Testing and converting characters3m 15s
-
(Locked)
Challenge: Character I/O and conversions34s
-
(Locked)
Solution: Character I/O and conversions1m 37s
-
(Locked)
Understanding strings in C2m 46s
-
(Locked)
Fetching string input3m 45s
-
(Locked)
Sending string output3m 41s
-
(Locked)
Challenge: Using printf placeholders1m 9s
-
(Locked)
Solution: Using printf placeholders1m 59s
-
(Locked)
Exploring string functions2m 41s
-
(Locked)
Manipulating strings2m 57s
-
(Locked)
Chapter challenge: Reading commands1m 52s
-
(Locked)
Chapter solution: Reading commands2m 31s
-
-
-
-
-