int main()
{
Int a, b, sum/1.defines variables, where int stands for data type-integer, sum.
Printf ("Please enter two integers:");
Scanf("%d %d ",&i, & b); //2. Input data, %d represents the limit of input type-integer, give these two numbers to&A and & B two variables,&; Address extraction operator;
sum = a+b; //Third, data processing: assign the sum of A and B to SUM;
Printf ("The sum of these two numbers is: %d\n", sum); //Fourth, output the result. %d outputs an integer, which is sum.
Printf ("Calculation completed, thanks for using!" );
Returns 0; //return;
}
Extended data:
C language writing rules:
1. A description or statement occupies one line.
2. The part enclosed by {} usually represents a certain hierarchical structure of the program. {} is generally aligned with the first letter of a structural statement and occupies a single line.
3. Lower-level statements or explanations can be written by indenting several cells compared with higher-level statements or explanations. In order to look more clear and increase the readability of the program. When programming, we should try to follow these rules to develop a good programming style.
References:
Baidu encyclopedia -c language