Data and Simple Computing Program (2)

Source: Internet
Author: User

Section II data, types, and simple programs

First, common basic types

1, integer int long int (long)

(2 bytes) (8 bytes)

2, float float single-precision type

Double Dual Precision Type

3, character type (ASCII code) char

(integer type)

Example: int long double float

35L 2.5 2.5f

Scientific counting Method:

Example: 3+108 (2e8 (integer)) (scientific notation belongs to floating-point type)

int:

120 binary

O12 octal

ox12 Hex

Second, function printf and simple text output program

Format: printf (String)

"Formal parameters (formal parameter)"

printf ("Hello")

"Actual parameter (argument)"

Significance:

Sends a string to the display hardware.

PLACEHOLDER:

1,%d integer placeholders

2,%ld Long integer placeholders

3,%f decimal digit double-precision placeholder

4,%LF decimal digit long double precision placeholder

5,%e scientific counting method placeholder

6,%g computer according to choose%e or%f

7,%c character placeholder

8.%s String placeholder

Data and Simple Computing Program (2)

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.