C# Basics Tutorial

Welcome to C# Basics

This tutorial will guide you through the fundamentals of C#.

Image 1

Basic Syntax

Let's start with the basics: `using System;`

This imports the System namespace, which contains essential classes and methods.

Variables

Variables are used to store data.

Example: `int age = 25;`

Data Types

Data types determine the kind of value a variable can hold.

Adding Variables

Let's add some variables:

int count = 10;

string message = "Welcome to C#!";

double price = 99.99;

Basic Statements

Statements are executed to perform actions.

Example: `Console.WriteLine("Hello");`

Conditional Statements

Let's use `if` to make decisions.

if (age >= 18) { Console.WriteLine("You are an adult."); } else { Console.WriteLine("You are a minor."); }

Looping

Loops repeat a block of code.

for (int i = 0; i < 5; i++) { Console.WriteLine("Iteration: " + i); }