Here is a simple question, if you know what your doing. Obviously I dont. Trying to learn C#, but for some reason, I cant get the 2nd ReadLine block of code to work in the following code. Any advice would be greatly appreciated.
using System;
namespace MyConsoleApplication
{
class Class1
{
[STAThread]
public static void Main()
{
//display "Hello World!" on the screen
System.Console.WriteLine("Hello World!"
//display the current date and time
System.Console.WriteLine("The date and time is " + System.DateTime.Now);
//displays user to enter a character, assigns variable with char and displays
System.Console.Write("Please enter a character: "
char userInput = (char) System.Console.Read();
System.Console.WriteLine("You entered the letter " + userInput);
//displays user to enter string, assigns variable with string and displays
System.Console.Write("Enter a string: "
string myString = System.Console.ReadLine();
System.Console.WriteLine("You entered " + myString);
}
}
}
using System;
namespace MyConsoleApplication
{
class Class1
{
[STAThread]
public static void Main()
{
//display "Hello World!" on the screen
System.Console.WriteLine("Hello World!"
//display the current date and time
System.Console.WriteLine("The date and time is " + System.DateTime.Now);
//displays user to enter a character, assigns variable with char and displays
System.Console.Write("Please enter a character: "
char userInput = (char) System.Console.Read();
System.Console.WriteLine("You entered the letter " + userInput);
//displays user to enter string, assigns variable with string and displays
System.Console.Write("Enter a string: "
string myString = System.Console.ReadLine();
System.Console.WriteLine("You entered " + myString);
}
}
}