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

1 Expert Approved Answer
Step: 1 Unlock

Solution Code and outpu... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!