C#

C# (C-Sharp) is a programming language developed by Microsoft that runs on the .NET Framework.C# is used to develop web apps, desktop apps, mobile apps, games and much more.Start learning C# now »

Examples in Each Chapter

Our "Try it Yourself" tool makes it easy to learn C#. You can edit C# code and view the result in your browser.

Example

using System;

namespace HelloWorld
{
  class Program
  {
    static void Main(string[] args)
    {
      Console.WriteLine("Hello World!");    
    }
  }
}

Try it Yourself »

Click on the "Run example" button to see how it works.

We recommend reading this tutorial, in the sequence listed in the left menu.

C# Exercises

Test Yourself With Exercises

Exercise:

Insert the missing part of the code below to output "Hello World!".

static void (string[] args)
{
  .("Hello World!");    
}

Start the Exercise

Learn by Examples

Learn by examples! This tutorial supplements all explanations with clarifying examples.

C# Quiz

Learn by taking a quiz! The quiz will give you a signal of how much you know, or do not know, about C#.

#img_mylearning { max-width:100%; }

My Learning

Track your progress with the free "My Learning" program here at w3resource.

Log into your account, and start earning points!

This is an optional feature. You can study w3resource without using My Learning.

#w3_cert_badge { position: absolute; right: 5%; width: 220px; transform: rotate(10deg); bottom: -20%; } #w3_cert_arrow { position: absolute; right: 220px; width: 220px; transform: rotate(10deg); bottom: 0; z-index: 1; } #getdiploma { position: relative; padding: 0 60px 50px 60px; margin-bottom: 125px; border-radius: 16px; background-color: #282A35; color: #FFC0C7; font-family: 'Source Sans Pro', sans-serif; } #getdiploma h2 { font-size:50px; margin-top: 1em; margin-bottom: 1em; font-family: 'Source Sans Pro', sans-serif } #getdiploma p { font-size: 42px; margin-top: 1em; margin-bottom: 1em; font-family: 'Source Sans Pro', sans-serif } #getdiploma a { border-radius: 50px; mxargin-top: 50px; font-size: 18px; background-color: #04AA6D; padding: 17px 55px } #getdiploma a:hover, #getdiploma a:active { background-color: #059862 !important; } @media screen and (max-width: 1442px) { #w3_cert_arrow { right: 212px; bottom: -15px; } } @media screen and (max-width: 1202px) { #w3_cert_arrow { display: none; } } @media screen and (max-width: 992px) { #w3_cert_arrow { display: block; } } @media screen and (max-width: 800px) { #w3_cert_arrow { display: none; } #getdiploma h2 { font-size: 44px; } #getdiploma p { font-size: 30px; } #getdiploma a { width: 100%; } #w3_cert_badge { top: -16px; right: -8px; width: 100px; } #getdiploma { margin-bottom: 55px; } }

Kickstart your career

Get certified by completing the course

w3schools CERTIFIED . 2022