C# Program to concatenate two strings

In this C# program, we will take the input strings from the user and print the concatenated string.

C# Program to concatenate two strings Code:

 private static void Main(string[] args)
        {
            string str1,str2,result;

            Console.Write("Enter first string : ");
            str1 = Console.ReadLine();

            Console.Write("Enter second string : ");
            str2 = Console.ReadLine();

            result = string.Concat(str1, str2);
            Console.Write("Output: "+result);
            Console.ReadLine();
        }

C# Program to concatenate two strings Output:

CSharp-program-to-concatenate-two-strings

 
About Us | Terms of Use | Privacy Policy | Disclaimer | Contact Us Copyright © 2012-2024 CodingFusion
50+ C# Programs for beginners to practice