Dark Horse programmer------C language Learning notes---Basic grammatical components of C language

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.