GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing www.tutorialspoint.com — C# Tutorial
Selected Reading
C# TutorialIntroduction to C#C# (pronounced "C-Sharp") is a simple, modern, general-purpose, object-oriented programming language developed by Microsoft within its .NET initiative led by Anders Hejlsberg. It is widely used for the following:
Write, Compile, & Run C# Code InstantlyOur C# tutorial allows you to execute code inline without leaving the page unlike other sites. Learn C# hands-on with real-time coding experience right here! Main features of this tutorial:
Click the Edit & RUN using System;
class Program{
static void Main(string[] args){
Console.WriteLine("Welcome to TutorialsPoint");
}
}
Why Learn C#?
Getting Started with C#To run C# programs, you need the following tools:
But wait! You dont need to install anything. Run the examples below right here in our tutorial! First C# Program "Hello, World!"Run This Code Instantly by clicking Edit & Run button! using System;
class Program
{
static void Main(string[] args)
{
// Tp print "Hello, World!"
Console.WriteLine("Hello, World!");
}
}
Explanation:
C# Syntax & BasicsC# programs follow a structured format. Heres an example with variables, data types, and user input: Test the code below by clicking Edit & Run button! You can modify the values and run the code to practice well. using System;
class Program
{
static void Main()
{
int age = 25;
string name = "Alice";
Console.WriteLine("Name: " + name);
Console.WriteLine("Age: " + age);
}
}
C# Variables & Data TypesData Types in C#
Try the Example Below! using System;
class Program
{
static void Main()
{
double price = 99.99;
bool isAvailable = true;
Console.WriteLine("Price: $" + price);
Console.WriteLine("In Stock: " + isAvailable);
}
}
Modify values & test! C# Control StatementsControl flow statements help in decision-making and looping. If-Else StatementRun This Conditional Check! using System;
class Program
{
static void Main()
{
Console.Write("Enter your age: ");
int age = Convert.ToInt32(Console.ReadLine());
if (age >= 18)
Console.WriteLine("You are eligible to vote!");
else
Console.WriteLine("Sorry, you must be 18+ to vote.");
}
}
Modify values & test! Loops in C#C# supports various loops:
Try a Simple Loop: using System;
class Program
{
static void Main()
{
for (int i = 1; i <= 5; i++)
{
Console.WriteLine("Iteration: " + i);
}
}
}
Modify the loop condition and see what happens! C# Functions & MethodsFunctions in C# allow code reusability. Run This Function Example using System;
class Program
{
static void Greet(string name)
{
Console.WriteLine("Hello, " + name + "!");
}
static void Main()
{
Greet("Alice");
Greet("Bob");
}
}
Modify the function call with different names! OOP in C# (Classes & Objects)C# is object-oriented, meaning it uses classes & objects. Create & Use Objects using System;
class Car
{
public string Brand;
public void ShowBrand()
{
Console.WriteLine("Car Brand: " + Brand);
}
}
class Program
{
static void Main()
{
Car myCar = new Car();
myCar.Brand = "Tesla";
myCar.ShowBrand();
}
}
Change Brand and see different outputs! C# File Handling (Read & Write)Read & Write Files in C#. Try this code on your local computer. using System;
using System.IO;
class Program
{
static void Main()
{
File.WriteAllText("test.txt", "Hello, C#!");
string content = File.ReadAllText("test.txt");
Console.WriteLine("File Content: " + content);
}
}
This will create a file called test.txt in your local directory. Check the content of the file. Why Learn C# with Us?
Who Should Learn C#?C# is perfect for beginners, software developers, game developers, and enterprise professionals. Whether you're building Windows applications, web apps, mobile apps (Xamarin), Unity games, or AI solutions, C# is a versatile and powerful language.
Start learning C# today and unlock endless opportunities in tech! Prerequisites to Learn C#C# is beginner-friendly, but having some basic knowledge can make learning easier:
No prior coding experience? No worries! Our tutorial covers everything from scratch. Advertisements
| ||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |