Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# readline example

// C# program to illustrate
// the use of Console.ReadLine()
// to pause the console
using System;
using System.IO;
 
class Geeks {
     
    // Main Method
    public static void Main()
    {
        string name;
        int n;
 
        Console.WriteLine("Enter your name: ");
         
        // typecasting not needed as
        // ReadLine returns string
        name = Console.ReadLine();
         
        Console.WriteLine("Hello " + name +
             " Welcome to GeeksforGeeks!");
         
        // Pauses the console until
        // the user presses enter key
        Console.ReadLine();
    }
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #readline
ADD COMMENT
Topic
Name
5+4 =