
(Practice) a. Write a declaration to store the string "This is a test" in an array named strtest. Include the declaration in a
NUMDISPLAY is a named constant for the number 14.
b. Modify the for statement in Exercise 5a to display only the array characters t, e, s, and t.
c. Include the array declaration written in Exercise 5a in a program that uses a cout statement to display characters in the array. For example, the statement cout << strtest; causes the string stored in the strtest array to be displayed. Using this statement requires having the end-of-string marker, \0, as the last character in the array.
d. Repeat Exercise 5a, using a while loop. (Hint: Stop the loop when the \0 escape sequence is detected. The expression while

Want to see the full answer?
Check out a sample textbook solution
Chapter 7 Solutions
C++ for Engineers and Scientists
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning

