|
Name
|
Example
|
|
bool
|
bool flag = True |
|
char
|
char c = '#' |
|
string
|
string text = "cake is great" |
|
int
|
int x = 29 |
|
double
|
double a = 3.14 |
|
From
|
To
|
Use
|
|
double
|
int
|
(int)x |
|
string
|
int
|
int.Parse(x) |
a = (int)7.2
datatype[] name = new datatype[size]int[] arr = new int[2]datatype[] name = {value1, value2, ...}string[] names = {"Bob", "Jack", ...}datatype[,] name = new datatype[size0, size1]int[,] arr = new int[2, 4]|
Branching
|
Looping
|
if (condition) { |
while (condition) { |
elseif (condition) { |
do { |
else { |
for (initialization; condition; step) { |
|
Operator
|
Meaning
|
|
&&
|
and
|
|
||
|
or
|
|
!
|
not
|
|
Line Input
|
Console.ReadLine() |
|
Line Output
|
Console.WriteLine() |
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.