Thursday, May 19, 2011

Program for user input


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Greetings! What is your name?");
            Console.Write("My name is: ");
            string name = Console.ReadLine();
            Console.WriteLine("Nice to meet you, " + name);
            Console.Read();
        }
    }
}

Next 

No comments:

Post a Comment