This tutorial will guide you through the fundamentals of C#.
Let's start with the basics: `using System;`
This imports the System namespace, which contains essential classes and methods.
Variables are used to store data.
Example: `int age = 25;`
Data types determine the kind of value a variable can hold.
Let's add some variables:
int count = 10;
string message = "Welcome to C#!";
double price = 99.99;
Statements are executed to perform actions.
Example: `Console.WriteLine("Hello");`
Let's use `if` to make decisions.
if (age >= 18) {
Console.WriteLine("You are an adult.");
} else {
Console.WriteLine("You are a minor.");
}
Loops repeat a block of code.
for (int i = 0; i < 5; i++) {
Console.WriteLine("Iteration: " + i);
}