This article explains how to get an input from the console. If you have used C++ then cin and cout are the functions for read and write to the console. Type this code in a text editor and save file as read.cs.using System;class ReadStr{public static void Main(){Console.Write("Enter your name:");string szName = Console.ReadLine();Console.WriteLine(" Hey "+ szName);}} Now compile it from command line with syntax cs read.cs. It will create an exe, read.exe in same dir where your read.cs file is. Run the exe.NOTE: I like to use my VC++ editor to create a text file and save it as .cs extension.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: