0% found this document useful (0 votes)
19 views

Strings Quiz

The program prompts the user to enter a string of at least 20 characters and stores it in the variable Str. It then prints the string's length, reverses the string, concatenates "Hello World" to it, counts the number of words, and converts the whole string to lowercase.

Uploaded by

muhammadahsan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Strings Quiz

The program prompts the user to enter a string of at least 20 characters and stores it in the variable Str. It then prints the string's length, reverses the string, concatenates "Hello World" to it, counts the number of words, and converts the whole string to lowercase.

Uploaded by

muhammadahsan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Write a C++ program that swaps values of two float type variables A and B.

For swapping you can


use third variable temp to store values temporary. All accesses to the variables (A, B, and temp)
should be made through pointer notation only. In the end, print the values of variables (A, B) on the
screen. Please also note that during input (cin) and output (cout) the variables must be accessed
through pointers only.

Write a C++ program that asks the user to enter a string value in a variable named “Str”. The input
string should be of size 20 characters (minimum). Next, apply following operation (in sequence) on
the input string:
1) Find and print the length of the string.
2) Display string in reverse order.
3) Concatenate “Hello World” to the string.
4) Count number of words in updated string. 5) Convert whole string in lowercase

You might also like