01 data type, constant quantity, operator, expression, formatted input and output

Source: Internet
Author: User

In-Process conversion:

1, in order to distinguish the octal, hexadecimal difference: octal before adding 0, hexadecimal x0, such as 058,x059;

2, the conversion of binary, binary, octal, decimal, hexadecimal conversion between. (conversion to binary after the other good conversion)

such as: decimal number 57, binary 111001, from binary to octal system, from the right of the binary to the left 3 digits of a group, the front is not enough to fill 0, that is 111,001, calculated octal 071;

Conversion from binary to 16, from the right of the binary to the left 4 digits of a group, the front is not enough to fill 0, that is 0011,1001, the calculation of hexadecimal as 0x39;

3, Notes

Single-line Comment

/**/Multiple Line comments

4. Basic data type

Commonly used are 3, char, int, float, 1 characters, 4 characters, 4 or 8 characters respectively; placeholder%c,%d,%f

5, variable, representing a storage area

type modifier type name = initial value

eg:int age = ten;

6. Naming rules for variable names

Can only be made up of numbers, words ⺟, underscores, and numbers cannot begin

Cannot have the same name as a system reserved word

Cannot make ⽤ with a duplicate variable name.

⻅ (standard) See name

Hump nomenclature: The first letter in lowercase, the rest of the first letter in uppercase. such as: Studentage

Operator:

7. Note: The expression is a constant, a combination of a variable, an operator, and an expression that returns a value

8, the statement is the smallest unit of program execution, ending with a semicolon

9, input, output statements

scanf () If the Read ⼊ data item type matches the format character, continue reading the ⼊; Otherwise no longer view the remainder, ⽴ is returned

printf (format string, expression 1, expression 2);

A format string consists of a common character and a transformation character.

10, escape character

printf ("\ \ n");

printf ("%%\n");

Escape character

11. Conversion format Control Conversion format control

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.