Using Logical Operators example

Using Logical Operators example

logical operators in c# with example,Logical operators allow you to combine multiple conditions. These operators involve at least two conditions and the final boolean result is determined by the operator being…
Nesting if Statements

Nesting if Statements

You can nesting if statements in C#. This is simply placing if statements inside if statements. You can make something as complex as the code that follows. if (condition) { code to execute; if (condition)…
Multiple Selection if Statements

Multiple Selection if Statements

What if you have more conditions to test? You can write multiple if Statements but wouldn't it be better if you can combine those if statements into one whole list.…
Conditional Operator

Conditional Operator

The c# ternary operator (?:) in C# does the same thing as the if else statement though it is more suited on simple statements such as assigning two different values depending…
If else Statement

If else Statement

C# if else Statement we presented last time is only good if you want to execute a code when one condition is met. But what would you do if you…
If Statement

If Statement

c# if statement-A program cannot think if it cannot make a decision. C# allows you to execute codes if certain conditions are true or false. By using an ifstatement and…
Making Decisions

Making Decisions

C# control statements-Almost every programming languages allows you to execute a code when a certain condition is met. This adds logic to your program. Imagine a program that cannot make…
Getting Input From User

Getting Input From User

User input is essential for a program to execute its functions and give you the data you want. The .NET Framework has some methods available to you for getting user…
C# Operator Precedence

C# Operator Precedence

C# Operator precedence determines which to calculate first in an expression involving more than two operands. Operators in C# has their own priority during calculation, and the compiler calculates those with…
Bitwise and Bitshift Operators

Bitwise and Bitshift Operators

bitwise operators allow you to manipulate different kinds of data in their binary form. In order to follow this lesson, it is recommended that you know what binary system is…
Logical Operators

Logical Operators

Logical operators typically involve boolean values and  yields boolean results. There are often use to create multiple or complex conditions. We have learned that a  boolean value can either be true or false. We…
Comparison Operators

Comparison Operators

C# has comparison operators which are used when comparing values or references of variables. These operators yield boolean results. Values yielded by comparison expressions are either true if the comparison is, in fact,…
Assignment Operators

Assignment Operators

Assignment Operators are shortcuts for modifying the value of a variable and immediately assigning the result to the variable itself. It is used to modify the value of the left operand…
Mathematical Operators

Mathematical Operators

C# Math Operators has available operators for use in mathematical calculations. By combining operators and operands, we have an expression which is how C# makes calculations. Here is a table…
Expressions and Operators

Expressions and Operators

C# operator :-Modern programming languages have a set C# operator which is one of the common elements of a programming language. C# offers mathematical operators, assignment operators, and comparison operators.…