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!

Popular posts from this blog

Write a program to check whether empty query string is entered in Asp.Net.

Mandavrayji Temple, Muli, Surendranagar, Gujarat

Write a program to change color of Label text control programmatically in Asp.Net.