Values and Variables on the Console |
As mentioned already, the applications we will create display in a dark object called the DOS window. Here is an example showing some values:
To display a value in this window, you can enter it in the parentheses of the Console.Write() or Console.WriteLine(). Here are two examples: If you write Console.WriteLine() with empty parentheses, an empty line would be displayed. In future lessons, we will learn what the meanings of Console, Write(), and WriteLine().using System;
class Program
{
static void Main()
{
Console.WriteLine(248);
Console.Write(1);
}
}
No comments:
Post a Comment