If you need to find out if the number is a Power of 2 using BitWise Operator in C# , below is a sample code snippet that demonstrates how to do it.
How to Use the Null Coalescing Operator (??) in C# ?
There are times when you simply want to check if the value is null and perform some steps based on the condition . The Null Coalescing Operator (??) can help you achieve this.
How to Use the Null Coalescing Operator
…Using Null Coalescing Operator in C#
Sometimes , you may want to simply the Null checks in your .NET Program without much usage of the if statements .
The Null Coalescing Operator can be used in this scenario.
Using Null Coalescing Operator in C#
using System;
Using or Operator in the Where Clause of LINQ in C#
Below is a sample code snippet demonstrating on how to use “Or” Operator in the Where Clause of Linq in C#?
Using or Operator in the Where Clause of LINQ in C#
using System; using System.Collections.Generic; using System.Data; using System.Linq;
How to use SQL like Operator in LINQ and C#?
In a SQL Query, one might use the Like Query which can be used along with the % operator to search of contains within the data. How to use SQL like Operator in LINQ and C#? This article will show …
The ? (ternary) Operator in C#
The ? Operator is the ternary operator and takes the following form
Expression1? Expression2: Expression3;
The Expression1 is an expression which returns Boolean result. Expression2 is considered if the Expression1 is true else Expression2 is taken.…
& and && in C#
Below is a sample soucrecode demonstrating the usage of & and && operator in c#.
using System; namespace AbundantCode { internal class Program { //& and && in C# private static void Main(string[] args) { bool Input1 = true, input2
Postfix and Prefix Operator in C#
Below is a sample code snippet demonstrating the Postfix and Prefix Operator in C#
using System; namespace AbundantCode { internal class Program { //Arithmetic Operators in C# private static void Main(string[] args) { int Input = 100; Input = Input++;
@ Operator in C#
Although it is not the best practise , If you want use the reserve words and the variable name , you could use the @ prefixed before the variable name .
Below is a sample sourcecode that demonstrates the use …