C# code to prompt a user to input his/her name and country name and then the output will be shown as like: Hello Ram from country India!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace writenameandcountry
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter your name:");
string name = Console.ReadLine();
Console.WriteLine("Enter your country name:");
string country = Console.ReadLine();
Console.WriteLine("Hello {0} from country {1}!", name, country);
Console.ReadKey();
}
}
}
Output:
Enter your name:
Ram
Enter your country name:
India
Hello Ram from country India!