Dark Horse programmer------<a href= "http://www.itheima.com" target= "blank" >java training, Android training, iOS training,. NET training </a>, look forward to communicating with you! -------
1.1 Basic grammatical components of C language
#include <stdio.h>intMain () {#definePI 3.14intR; Doubles; Doublem; //Prompt user to enter RADIUSprintf"Please enter radius: \ n"); //accept the radius of user inputscanf"%d",&R); S=2*pi*R; M= pi*r*R; printf ("the circumference and area of the circle are%f%f\n, respectively.", s,m); return 0;}
01 identifiers:
* Identifiers can only consist of letters, numbers, underscores, and the first character must be an underscore or a letter
* Case Sensitive
* Does not limit the length of identifiers, but each compilation system has its own rules and restrictions
* The identifier cannot have the same name as the keyword and cannot be the same as the system's own identifier.
02 Keywords: pre-defined C-language identifiers with specific meanings
03 Operator: Divided into monocular operator, binocular operator, trinocular operator
L% must all be integers, results take remainder
L/Result out of remainder, take integer
L character data can be mixed with integer data such as: ' A ' +32
The precedence of the L operator is first multiplication and minus, followed by "left-to-right" if the same level is the same
L i++,i--(after using I, I plus minus 1)
L ++i,--i (before using I, I add minus 1)
#include <stdio.h>intMain () {intA =5; intb =Ten; inttemp; Temp=A; A=b; b=temp; printf ("a=%d b=%d\n", A, b); return 0;}//The second method ofA = B-a;b= B-A;a= b +a;
Dark Horse programmer------C language Learning notes---Basic grammatical components of C language