Lab 09
Lab 09
PROGRAMMING FUNDAMENTALS
Lab 09: Understanding Arrays - II
Under
Strings are used for storing text, a string variable contains a collection of characters surrounded by
double quotes:
To use strings, you must include an additional header file in the source code, the <string> library:
3 5 4
7 6 9
2 1 8
Output
Middle Row: 7 6 9
Middle column: 5 6 1
2. Write a program in C++ that take String as an input from user and print only
alphabets from the sentence.
Input:
Output Hellohwareyou
3. Write a program that will read in a line of text and output the number of words.
4. Write a program that reads in a line of text and replaces all four-letter words with the word
“work”. For example,
Input:
…END…