Statement:
Conditional operator:?:
Conditional statement: Implementing a selection Branch
if (conditional expression)
{
...
}
Looping statements: Implementing repetitive operations
Jump statement: End loop
Exception statement:
Operator:
Arithmetic operators: +-*/% + +--
Comparison operator: < > <= >= = = =!
Logical operators: && | | !
Precedence of the operation: parentheses within the first parentheses
Before + + before--
* / %
+ -
> < >= <= = = =!
&& | |
!
#region = = Arithmetic operator = =
int A, b, C;
A = a + B; When the value in the original A is added to the value in B, the result is assigned to a
a++;//a=a+1;
A--;//a=a-a;
++a;
--a;
int d = a++;//after the execution of the statement after the execution of the order is int d=a; a=a+1;
int e = ++a;//Pre-Gaga execution order before statement execution is a=a+1; int e =a;
#endregion
#region = = comparison operator = =
int A, B;
Console.Write ("Input A:");
A = Convert.ToInt16 (Console.ReadLine ());
Console.Write ("Input B:");
b = Convert.ToInt16 (Console.ReadLine ());
BOOL C = a > b;//determine if A is greater than B. The comparison expression returns a bool value
Console.WriteLine (c);
#endregion
#region = = logical operator = =
while (true)//infinite Dead loop
{
int A, b, C;
Console.Write ("Input a");
A = Convert.ToInt16 (Console.ReadLine ());
Console.Write ("Input B:");
b = Convert.ToInt16 (Console.ReadLine ());
Console.Write ("Input C:");
c = convert.toint16 (Console.ReadLine ());
BOOL E = a > B && a > C;
BOOL F =! (A > B && a > C);//The meaning of the inverse value
Console.WriteLine (e);
Console.ReadLine ();
}
#endregion
The use of #region = = =
int A, b, C;
Console.Write ("Input a");
A = Convert.ToInt16 (Console.ReadLine ());
Console.Write ("Input B:");
b = Convert.ToInt16 (Console.ReadLine ());
string s = a > B? "A>b": "A<b"; If A>b is displayed when A>B is established, the reverse is displayed a<b
Console.WriteLine (s);
#endregion
20150908 Statement and operator