Saturday, September 17, 2011

Use While to read user input

Module Module1

    Sub Main()
        Console.WriteLine("Please enter 'q' to quit...")
        Dim strInput As String = Console.ReadLine()

        While (strInput <> "q")
            Console.WriteLine("You typed " & strInput)
            Console.WriteLine("Please enter 'q' to quit...")
            strInput = Console.ReadLine()
        End While
        Console.WriteLine("Quitting now.")

    End Sub

End Module

No comments:

Post a Comment

Explain the different parts that constitute ASP.NET application.

Content, program logic and configuration file constitute an ASP.NET application. Content files Content files include static text, images ...