VOOZH about

URL: https://www.geeksforgeeks.org/interview-experiences/tcs-coding-practice-question-concatenate-2-strings/

⇱ TCS Coding Practice Question | Concatenate 2 Strings - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

TCS Coding Practice Question | Concatenate 2 Strings

Last Updated : 11 Jul, 2025
Given two Strings, the task is to concatenate the two Strings using Command Line Arguments. Examples:
Input: str1 = "hello", str2 = "world"
Output: helloworld

Input: str1 = "Geeks", str2 = "World"
Output: GeeksWorld
Approach:
  • Since the Strings are entered as Command line Arguments, there is no need for a dedicated input line
  • Extract the input Strings from the command line argument
  • Concatenate the given strings using the respective methods.
  • Print or return the concatenated strings
Program: Output:
Comment