Operators in C#
Arithmetic –
+, -, *, /, %
Assignment –
=, +=, -=, *=, /=, %=
Comparison –
++, !+, <, <=, >, >=, is, as, like.
Concatenation –
+
Increment and decrement –
++ , --Logic –
&& , ||, ^
Conditional statement: -
A block of code which gets executed basing on a condition is a conditional statement. There are two types- Conditional branching.
- Conditional looping.
1. Conditional branching –
This statement is also allow you to branch your code depending on whether certain condition were met or not. C# has two constructs for branching code, the if statement which allows you to test whether a specific condition is met and the switch statement which allows you to compare and expression with a no. of different values2. Condition loop –
C# provides 4 different loops that allows you to execute a block of code repeatedly until the certain condition is mat those are –- for loop
- while loop
- do …. while loop
- foreach loop
1. Initialization – which sets the starting point of loop.
2. Condition – which sets the end of a loop.
3. Iteration – this tacks you to the next level of the loop, either in forward or backward
direction.
FOR LOOP –
DO…… WHILE LOOP –
This is similar to while loop but for the first execution of the loop it doesn’t require any condition test. After completing the execution for one time then it checks for the condition to execute for next time.FOREACH LOOP –
It is a special loop that has been design for the processing of arrays and collection.
Note- array is the set of similar type value, and the collection is the set of dissimilar type value.
JUMP STATEMENT –
C# provides a no. of statements that allow you to jump immediately to another line in a program w have four different jump statement support inC# those are –
1. goto
2. break
3. continue
4. return
0 Comments