mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2025-12-06 05:32:03 +01:00
21 lines
454 B
C#
21 lines
454 B
C#
|
|
int a = 3;
|
|||
|
|
int b = a++;
|
|||
|
|
WriteLine($"a is {a}, b is {b}");
|
|||
|
|
|
|||
|
|
int c = 3;
|
|||
|
|
int d = ++c; // increment c before assigning it
|
|||
|
|
WriteLine($"c is {c}, d is {d}");
|
|||
|
|
|
|||
|
|
int e = 11;
|
|||
|
|
int f = 3;
|
|||
|
|
WriteLine($"e is {e}, f is {f}");
|
|||
|
|
WriteLine($"e + f = {e + f}");
|
|||
|
|
WriteLine($"e - f = {e - f}");
|
|||
|
|
WriteLine($"e * f = {e * f}");
|
|||
|
|
WriteLine($"e / f = {e / f}");
|
|||
|
|
WriteLine($"e % f = {e % f}");
|
|||
|
|
|
|||
|
|
double g = 11.0;
|
|||
|
|
WriteLine($"g is {g:N1}, f is {f}");
|
|||
|
|
WriteLine($"g / f = {g / f}");
|