1. Use of code
computer language: C, PHP, Ruby, Java, C #, Basic, JS, C + +
Source code: is the content written in a computer language
compiling: Converting source code into machine code with compiler
Machine Language: Machine language is a language that can be understood and executed directly by the computer
2.c# Statement Output
output text to the current location of the console:
console.write ("text content"); output text at cursor position
Console.WriteLine ("Text content"), output text at the cursor position, and then wrap
3. Data type: Classification and generalization of data
Char Character type
String literal type
int integer type
Double Decimal type
4. Variables:
declaration of variable: data type variable name;
Assignment of variables: variable name = data;
5. Naming conventions for variables
Hard requirements:
① The rules that must be followed
② variable names can only be made up of numbers, letters, underscores
③ variable names must not start with a number
The ④ name cannot be the same as a keyword (with a special-purpose word)
⑤ variable names must not be the same in the same function
Soft Requirements:
① recommended rules to follow
② variable name to be able to look at the text to know the meaning
③ variable name first letter lowercase
④ In addition to the first word, capitalize the first letter of the other word
6. The writing format of the variable
Write separately: data type variable name;
variable name = variable value;
Merge writing: data type variable name = variable value;
7. Type conversion
numeric types with a small range of values → A numeric type with a large range of values "implicit conversions: no extra code required, computer auto-complete conversion"
numeric types with large range of values → numeric types with a small range of values "explicit conversions (casts): Additional code needs to be written and the computer does not automatically convert"
Explicit conversions (casts) can cause data loss
8. Data operations: Plus (+), minus (-), multiply (*), except (/), redundancy (%)
int type and int type for operation, return type int type
Double type and double type for operation, return type double type
int type and double type for operation, return type double type
9. Data type: For real numbers with high computational accuracy requirements, use decimal
C # language and variables, data types