Course Content
Introduction to C#
What is C#? C# (pronounced "C sharp") is a general-purpose, modern programming language developed by Microsoft as part of its .NET framework. It was first introduced in 2000 and has since become one of the primary languages used for building Windows desktop applications, web applications, and other software solutions on the Microsoft platform. C# is an object-oriented programming (OOP) language that combines the power and flexibility of C++ with the simplicity and ease of use of Visual Basic. It is designed to be a simple, efficient, and type-safe language that enables developers to create robust and scalable applications. Some key features of C# include: • Object-Oriented Programming (OOP): C# supports fundamental OOP concepts such as encapsulation, inheritance, and polymorphism, allowing developers to create modular and reusable code. • Type Safety: C# enforces strict type checking, which helps prevent errors and promotes code reliability. • Garbage Collection: C# includes automatic memory management through a garbage collector, which frees developers from managing memory manually. • Language Integration: C# integrates seamlessly with other .NET languages, allowing developers to leverage existing libraries and components. • Rich Standard Library: C# provides a comprehensive standard library that offers a wide range of functionality for common tasks, including input/output operations, network programming, and database access. • Platform Independence: While C# was initially designed for Windows development, it has expanded its reach through cross-platform frameworks like .NET Core and Xamarin, enabling developers to build applications that run on multiple operating systems, including Windows, macOS, and Linux. Overall, C# is a versatile language that empowers developers to build a variety of software applications, from desktop applications and web services to mobile apps and games, using the .NET framework.
0/4
Setting up the development environment
A key component of C# development is the Visual Studio integrated development environment (IDE). This lesson lets you look into the IDE. You learn how to configure it for C# development.
0/6
Basic syntax and concepts (C# Basics)
This topic contains fundamentals of C# programming
0/6
Classes and objects
Classes and objects In C#, classes and objects are fundamental concepts of object-oriented programming (OOP). They provide a way to define the structure and behavior of objects, which are instances of classes. Here's an overview of classes and objects in C#:
0/9
Advanced topics
Certainly! Here are a few advanced topics in C# that you might find interesting:
0/5
Project organization
0/1
About Lesson

An operator is a symbol that instructs the compiler to carry out particular logical or mathematical operations. In C#, we the following categories of operators:

  • Arithmetic Operators
  • Comparison/Relational Operators
  • Logical Operators
  • Assignment Operators
  • Bitwise Operators
  • Misc Operators

Arithmetic Operators

# Operator Name Description Example
1 + Addition Adds two values A+B
2 Subtraction Subtracts second value from first A-B
3 * Multiplication Multiplies two values A*B
4 / Division Divides numerator by denominator A/B
5 % Modulus Remainder after an integer division A%B
6 ++ Increment Increases the value of a variable by 1 A++
7 Decrement Decreases the value of a variable by 1 A–

Comparison/Relational Operators

# Operator Name Description Example
1 == Equal to Checks if the two values are equal A==B
2 != Not equal Checks if the two values are not equal A!=B
3 < Less than Checks if the left value is less than the right A<B
4 > Greater than Checks if the left value is greater than the right A>B
5 <= Less than or equal to Checks if the left value is less than or equal to the right A<=B
6 >= Greater than or equal to Checks if the left value is greater than or equal to the right A>=B

Logical Operators

# Operator Name Description Example
1 && Logical AND Checks if BOTH values are non zero. Returns True if both values/expressions evaluate to True A&&B
2 || Logical OR Checks if ANY of the values is non zero. Returns True if at least one of the values/expressions evaluates to true A!=B
3 ! Logical NOT Reverses the logical state of its conditional expressions. True becomes false and vice versa !(A&&B)

Assignment Operators

# Operator Name Description Example Equivalent
1 = Assignment Assigns values from right hand side of the equal sign to left hand side A=B+C Assigns value of B+C into A
2 += Add AND assignment Adds right value to the left and assigns the result to left value A+=B A=A+B
3 -= Subtract AND assignment Subtracts right value from the left and assigns the result to left value A-=B A=A-B
4 *= Multiply AND assignment Multiplies right value with the left and assigns the result to left value A*=B A=A*B
5 /= Divide AND assignment operator Divides right value by the left and assigns the result to left value A/=B A=A/B
6 %= Modulus AND assignment Takes the remainder after dividing right value by the left and assigns the result to left value A%=B A=A%B
7 <<= Left shift AND assignment TBD A<<=B A=A<<B
8 >>= Right shift AND assignment TBD A>>=B A=A>>B
9 &= Bitwise AND and assignment TBD A&=B A=A&B
10 ^= bitwise exclusive OR and assignment TBD A^=B A=A^B
11 |= bitwise inclusive OR AND assignment TBD A|=B A=A|B

Bitwise Operators

# p q p&q (AND) p|q (OR) p^q (XOR) ~q (Complement)
1 0 0 0 0 0 1
2 0 1 0 1 1 0
3 1 1 1 1 0 0
4 1 0 0 1 1 1

Example:

# p q p&q p|q p^q ~q
1 00110011  (3 in binary) 00100111 (27 in binary) 00100011 = 35 (dec) 00110111 = 55 (dec) 00010100 = 20 (dec) 11001100 = 204 (dec)