- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C++ program to concatenate strings in reverse order
Suppose we have two strings S and T. Both are in lowercase letters. Concatenate T and S in this order to generate the final string.
So, if the input is like S = "ramming"; T = "prog", then the output will be "programming"
Steps
To solve this, we will follow these steps −
res := T concatenate S return res
Example
Let us see the following implementation to get better understanding −
#include <bits/stdc++.h> using namespace std; string solve(string S, string T){ string res = T + S; return res; } int main(){ string S = "ramming"; string T = "prog"; cout << solve(S, T) << endl; }
Input
"ramming", "prog"
Output
programming
- Related Articles
- C++ Program to Concatenate Two Strings
- Python – Concatenate Strings in the Given Order
- C Program to Reverse Array of Strings
- Write a C program to print the message in reverse order using for loop in strings
- Python program to concatenate Strings around K
- How to concatenate two strings in C#?
- C# Program to display a string in reverse alphabetic order
- C program to display numbers in reverse order using single linked list
- 8085 program to transfer a block in reverse order
- How to concatenate strings in R?
- Concatenate strings in Arduino
- Python program to count the pairs of reverse strings
- How to concatenate multiple C++ strings on one line?
- How to concatenate several strings in JavaScript?
- Different ways to concatenate Strings in Java

Advertisements