Professional Documents
Culture Documents
Basic Programming
Basic Programming
Data Types
Method
MATERIAL Condition
Array
Looping
int
long
float
DATA TYPES double
bool
char
string
3
4
+
-
ARITHMETIC /
OPERATOR *
%
5
==
>
RELATIONAL <
>=
OPERATORS <=
!=
6
LOGICAL OPERATOR
Operand 1 Operand 2 And (&&) Or (||)
7
COMPUND ASSIGNMENT OPERATORS
Operator Operator Name Example Equivalent To
Addition
+= x += 5 x=x+5
Assignment
Subtraction
-= x -= 5 x=x-5
Assignment
Multiplication
*= x *= 5 x=x*5
Assignment
8
9
VOID VS NON-VOID
Void Non-Void
No return Have return
No data type at declaration There’s a datatype at
declaration
Using keyword void Don’t using keyword void
10
11
IF Else
If (condition)
{
Statement
} else if (condition) {
IF ELSE Statement
} else {
Statement
}
12
Switch Case
Switch (condition)
{
Case 1:
Statement;
Break;
}
13
14
Arrays are used to store multiple values in a single variable, instead of declaring
separate variables for each value.
15
17
FOR
18
FOREACH
19
While (condition){
Statement
};
WHILE
20
Do{
statement
}while (condition);
DO WHILE
21
https://www.c-sharpcorner.com/blogs/difference-
REFERENCES between-for-and-foreach-loop-in-c-sharp1
22