C# Concepts

C# Programming 101: A Cheat Sheet for Beginners

Programming Made Easy with This Quick Reference Cheat Sheet

Sukhpinder Singh | .Net Developer
C# Programming
Published in
3 min readFeb 23, 2023

--

C# (pronounced “C sharp”) is a modern, object-oriented programming language developed by Microsoft. It is widely used for creating desktop applications, games, mobile applications, and web services. As with any programming language, there are a lot of concepts, syntax, and libraries to learn. In this article, we will provide a cheat sheet that covers the most important aspects of C# programming.

Photo by Kelly Sikkema on Unsplash

C# Syntax Cheat Sheet

Variables and Data Types

C# supports data types like int, float, double, char, bool, etc. Declare variables with their respective data types as follows:

int x = 5;
float f = 3.14f;
double d = 3.14159;
char c = 'a';
bool b = true;

Control Flow Statements

Control flow statements like if-else, switch-case, for loop, while loop and do-while loop are used to control the flow of program execution.

if (condition)
{
// code to execute if condition is true
}
else
{
// code to execute if condition is false
}

switch (variable)
{
case value1:
// code to execute if variable == value1…

--

--

Sukhpinder Singh | .Net Developer
C# Programming

Programmer by heart | C# | .Net 6 | .Net 8 | dotnet | dotnetcore | Kubernetes | Angular | AWS | Remember to 👏 Linktree: https://linktr.ee/sukhpindersingh