EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login

C# Tutorial

Home Software Development Software Development Tutorials C# Tutorial

Basic

Uses Of C#

C# Versions

C# Data Types

Variables in C#

Namespaces in C#

C# Compilers

C# Keywords

C# URL Encode

C# get type of object

C# object compare

nhibernate in C#

Iterators in C#

Objects in C#

C# Object Dispose

Composition C#

C# object to XML

C# await

C# Hashtable

C# object to int

Dataset in C#

C# Read File

Encapsulation C#

C# check object type

C# Object Serialization

C# Object Equals

C# object sender

C# object initializer

C# object to dictionary

Pointers in C#

C# Literals

C# Commands

C# Command Line Arguments

C# Custom Attribute

Type Casting in C#

String vs String C#

C# Struct vs Class

Operators

Logical Operators in C#

Conditional Operators in C#

Bitwise Operators in C#

C# OR Operator

C# Ternary Operators

Operator Precedence in C#

Control Statement

C# if Statement

Else If in C#

Continue in C#

Break in C#

Switch Statement in C#

Goto Statement in C#

Loops

C# For Loop

C# While Loop

C# do-while loop

C# foreach Loop

Arrays

Arrays in C#

2D Arrays in C#

C# Jagged Arrays

String Array in C#

C# Multidimensional Arrays

Constructor and Destructor

Constructor in C#

Copy Constructor in C#

Static Constructor in C#

Destructor in C#

overloading and overrideing

Overloading and Overriding in C#

Overloading in C#

Overriding in C#

Method Overloading in C#

Method Overriding in C#

Operator Overloading in C#

Functions

C# Functions

C# String Functions

Math Functions in C#

Recursive Function in C#

C# Anonymous Functions

C# Local Functions

Enum in C#

Trim() in C#

clone() in C#

C# random

C# String Format()

C# String Interpolation

C# StartsWith()

C# String IndexOf()

DateTime in C#

Timestamp to Date C#

C# Nullable

C# nameof

C# Buffer

C# checked

C# String PadLeft

Convert String to Double in C#

Convert int to String C#

String to Date C#

C# intern()

C# EndsWith()

C# String Split()

C# Contains()

C# Stopwatch

C# DirectoryInfo

C# User Control

C# Compare()

C# Base

C# SOAP

Lock in C#

Advanced

Inheritance in C#

C# HashSet

C# Params

Reflection in C#

C# Career

MVVM C#

Abstraction in C#

Assembly Reference in C#

Entity Framework C#

Exception Handling in C#

Types of Exception in C#

C# CSV Reader

C# FileNotFoundException

C# NullReferenceException

C# OutOfMemoryException

C# StackOverflowException

Dataset to Datatable C#

Custom Exception in C#

What is Multithreading in C#?

Byte to String C#

C# Auto-Implemented Properties

C# Memory Leak

C# Nullable String

C# finally

C# System.IO

What is StringBuilder in C#

DataReader C#

BinaryWriter in C#

C# BinaryReader

TextWriter in C#

TextReader in C#

C# StringReader

C# StringWriter

C# StreamReader

C# StreamWriter

C# FileInfo

File Handling in C#

What is Design Pattern in C#?

Multithreading in C#

Sorting in C#

Bubble Sort in C#

C# SortedList

C# SortedSet

C# SortedDictionary

Abstract Class in C#

Access Modifiers in C#

C# Generics

Deserialization in C#

C# Thread

C# Thread Join

C# Thread Sleep

C# Thread Synchronization

C# Class

Sealed in C#

Sealed Class in C#

Polymorphism in C#

C# References

C# Call By Reference

Virtual Keyword in C# 

Yield Keyword in C#

Regular Expression in C#

C# Lambda Expression

C# Predicate

Convert Object to JSON C#

Checkbox in C#

C# MessageBox

Collections in C#

List in C#

C# LinkedList

Listbox in C#

Protected in C#

C# EventHandler

Private in C#

this Keyword in C#

Static Keyword in C#

C# Out Parameter

Assert in C#

C# Delegates

C# Interface

Generics in C#

Timer in C#

C# Serialization

Metadata in C#

C# Stack

C# Using Static

Queue in C#

C# File.Exists

C# Tuples

C# Create JSON Object

Partial in C#

C# readonly

C# Action Delegate

C# Await Async

C# Asynchronous

C# Dictionary

IEnumerable C#

C# Data Grid View

Static Class in C#

C# Dynamic

Web Services in C#

C# Pattern Matching

C# Extension Methods

C# XmlSerializer

C# DataTable

C# DataTable Filter

JSON Parser in C#

Active Directory with C#

Programs

Patterns in C#

Swapping in C#

Palindrome in C#

Factorial in C#

Fibonacci Series in C#

Random Number Generator in C#

Prime Numbers in C#

Armstrong Number in C#

Reverse String in C#

Interview questions

C# Interview Questions and Answers

C# OOP Interview Questions

C# Design Pattern Interview Questions

C# Tutorial and Resources

C#, pronounced as C-Sharp, is a programming language developed by Microsoft. It is an object-oriented programming language that is developed as a part of .Net initiative and designed by Anders Hejlsberg. It is a general-purpose programming language designed for Common Language Infrastructure. There are some standards for designing C#, like the language needs to be modern, general-purpose, and based on OOPS concepts. It should be suitable for deployment in distributed environments etc. Because of this, it was approved by Ecma as an international standard.

Why do we need to learn C#?

C# is widely used in multiple areas which makes it more popular and in demand. It is used in the area of Game Development because of its features like an object-oriented, automatic garbage collector, etc. It is also used in the area of web development and desktop applications. There are other features of C# like Integration with windows, properties, and events, Standard library, Indexers, Multithreading, etc., which are the reason for its worldwide popularity.

There are some advantages of C#

  • It is very efficient and consists of an automatic garbage collector feature.
  • Memory backup is high so there is no issue of memory leak.
  • It is safe than many other languages and also has low maintenance.
  • It is compiled to intermediate language irrespective of targeting OS.

Applications of C#

C# is used to build various types of applications like

  1. Web applications and windows services
  2. Gaming applications
  3. Enterprise applications
  4. Web services and API
  5. Machine learning and artificial intelligence
  6. Internet of Things
  7. Backend Services
  8. Window libraries and client applications
  9. Android mobile apps
  10. Other software like Office, SQL, etc.

Example

Below is the simple C# code example of print a message

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tutorial
{
class Program
{
static void Main(string[] args)      // Main Method
{
Console.WriteLine("This is C# Tutorial");    // Display message
Console.ReadKey();
}
}
}

  1. using is for including the System namespace, which is basically a collection of classes.
  2. The class consists of methods of the program. The above code consists of the main method which shows the behavior of the class.
  3. Static is the keyword that is used to tell whether this method is accessible or not without instantiating the class.
  4. Main() method is where the execution starts. Having only one main method in a program that specifies the behavior is mandatory. It is basically an invoked method to execute.
  5. WriteLine() is used to get output. We can write System.Console.WriteLine(), where System is a namespace with class Console, and WriteLine are the methods to display any message of a class.
  6. ReadKey() is held on the screen until a key is pressed.

The output of the above code is:-

C# tutorial

Prerequisites

It is good to have knowledge of the C language, which will help to understand the basics concepts and syntaxes.

Target audience

This is for the beginners so that they can understand the basics of C# programming and its applications and advantages.

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Software Development Course

C# Programming, Conditional Constructs, Loops, Arrays, OOPS Concept

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Special Offer - All in One Software Development Bundle (600+ Courses, 50+ projects) Learn More