C# is a general-purpose, type-safe, object-oriented programming language. It was developed around 2000 by Microsoft as part of its .NET initiative.
Console.WriteLine() method is used to print text to the console. It can also be used to print other data types and values stored in variables.
Console.ReadLine() method is used to get user input. The user input can be stored in a variable. This method can also be used to prompt the user to press enter on the keyboard.
Comments are bits of text that are not executed. These lines can be used to leave notes and increase the readability of the program.
- Single line comments are created with two forward slashes
- Multi-line comments start with
/*and end with
*/. They are useful for commenting out large blocks of code.
.NET is a free, cross-platform, open source developer platform for building many different types of applications.
With .NET, you can use multiple languages, editors, and libraries to build for web, mobile, desktop, gaming, and IoT. Whether you’re working in C#, F#, or Visual Basic, your code will run natively on any compatible OS. Different .NET implementations handle the heavy lifting for you.
- 1What would you like to build? If you can name it, you can probably build it with C#. This programming language can be used to make interactive websites, mobile apps, video games, augmented reality…
- 2Time to run some C# yourself! There are two panels here: a text editor containing some C# code and a console, or terminal, that shows output. When you run the code, you’ll see some text printed t…
- 3We can also read input from a user. The command Console.ReadLine() captures text that a user types into the console. In this example, the program writes a question to the console and waits …
- 4Ironically, an essential tool in programming is the ability to tell a computer to ignore a part of a program. Text written in a program but not run by the computer is called a comment. In C#, a…
- 5You’ve seen some examples of C# code in action, but learning a programming language is more than just memorizing commands: it’s understanding how it differs from other technologies, joining its com…
- 6Congrats! You finished your first lesson in C#. In this lesson you learned: * C# is used to make interactive websites, mobile apps, video games, augmented and virtual reality (AR and VR), back-end …