Console.WriteLine()
Prints a line of text to the console.
Console.WriteLine("Ready");Short entries with an example for each. When you need every detail, each entry links to the official documentation.
Prints a line of text to the console.
Console.WriteLine("Ready");Typed variables: int, double, bool, string and more.
int age = 12;
double price = 4.99;
bool ready = true;
string name = "Ada";Puts values inside text with $ and braces.
Console.WriteLine($"Total: {total}");Runs code only when a condition is true.
if (age >= 18)
{
Console.WriteLine("You can vote.");
}
else
{
Console.WriteLine("Not yet.");
}Repeat code a set number of times, or while a condition is true.
for (int i = 1; i <= 3; i++)
{
Console.WriteLine(i);
}Named, reusable code inside a class.
static int Square(int n)
{
return n * n;
}A list that can grow; foreach visits every item.
List<string> names = new List<string>();
names.Add("Asha");
foreach (string n in names)
{
Console.WriteLine(n);
}A class is a blueprint; new creates an object from it.
class Dog
{
public string Name;
}
Dog rex = new Dog();
rex.Name = "Rex";Reads a line of text typed by the user.
string name = Console.ReadLine();No entries match. Try a shorter word.