Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | May 2017 |
Last Sign in: | 307 Weeks Ago, 6 Days Ago |
Questions Answered: | 66690 |
Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
a. Write a declaration to store the string "This is a test" into an array named strtest. Include the declaration in a program to display the message using the following loop:
Â
b. Modify the for statement in Exercise 7a to display only the array characters t, e, s, and t.
c. Include the array declaration written in Exercise 7a in a program that uses the printf ( ) function to display characters in the array. For example, the statement printf ( "%s", strtest); will cause the string stored in the strtest array to be displayed. Using this statement requires that the last character in the array is the end-ofstring marker \ o.
d. Repeat Exercise 7a using a while loop.
Exercise 7a
a. Write a declaration to store the string "This is a test" into an array named strtest. Include the declaration in a program to display the message using the following loop:
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll