Question: Write a simple C++ program in which you define two strings str1, str2. Check if both strings are empty. Assign values Amjad Khan &
Write a simple C++ program in which you define two strings str1, str2.
- Check if both strings are empty.
- Assign values “Amjad Khan” & “ studying at University” to string str1 and str2 respectively.
- Check length of both strings.
- Print the character on index 2.
- Check if str1 is greater than str2 and vice versa.
- Append “ is” at the end of str1.
- Replace character ‘d’ with ‘q’.
- Append str1 with str2.
Step by Step Solution
There are 3 Steps involved in it
Solution Code and outpu... View full answer
Get step-by-step solutions from verified subject matter experts
