Thursday, September 20, 2018

How to read a value from user in Console application?

This article explains how to get an input from the user in  console.It is very basic program.

using System;
class ReadStringData

        {

            public static void Main()

            {

                Console.Write("Enter your name:");
                // String Variable 
                string YourName = Console.ReadLine();

                Console.WriteLine(" Hello Mr. " + YourName);
             
            }

        }
Note :- In this small console application get input from user and display on console screen.

Thank you.............

No comments:

Post a Comment