Job 4 Summary

Source: Internet
Author: User

1. Knowledge Points:

(1) Character type

Char ch;

(Ch >= ' a ' && ch <= ' z ') | | (Ch >= ' A ' && ch <= ' Z ')

(Ch >= ' 0 ' && ch <= ' 9 ')

• Character type data

Character variable: char ch; (defines the character variable ch for storing character data.) )

Character constant: ' A ' z ' ' a ' z ' 0 ' 9 ' \ n ' (2) input and output of character data • Character input function GetChar

Enter a character

Char ch;

ch = getchar ();

• Character output function Putchar

Output one character

Putchar (output parameter); (3) Logical operation

(Ch >= ' a ' && ch <= ' z ') | | (Ch >= ' A ' && ch <= ' Z ')

Ch >= ' 0 ' && ch <= ' 9 '

• Logical operators: &&;| | ;! ;

• Logical expression: A formula that connects a logical operand with a logical operator.

(4) Else–if statement

if (expression 1) Statement 1

else if (expression 2) Statement 2

else if (expression n-1) statement n-1

Else Statement n

(5) Switch statement

Handles multi-branch selection issues in 3 scenarios:

① use the break statement in each statement segment of the switch statement

switch (expression) {

case constant Expression 1: statement segment 1; Break

Case constant Expression 2: statement segment 2; Break

.......

case constant Expression N: statement segment n; Break

Default: statement segment n+1; Break

}

② do not use break in switch

switch (expression) {

case constant Expression 1: statement segment 1;

Case constant Expression 2: statement segment 2;

.......

case constant Expression N: statement segment n;

Default: statement segment n+1;

}

③ using break in certain statement segments of switch

• General form:

switch (expression)

{Case constant-expression 1: statement 1

Case constant Expression 2: statement 2

case constant Expression N: statement n

Default: Statement n+1

}

Job 4 Summary

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.