C # getting started with classic notes _ Ch04 Process Control

Source: Internet
Author: User

Chapter 04

4.1

1. var1 = var2 ^ var3;

2 .&

The results are the same,

4.1.1

1. processing is a series of bits stored in the variable, rather than the value of the variable.

&

<// Var1 = var2 <var3

>>// Var1 = var2 <var3

This number is multiplied by the number of shifts to the left.

 

Notice

In most codes, these operators are not used. They are mainly highly optimized code and cannot use other mathematical operations in the code. Therefore, they are usually used for device drivers or system code.

4.1.2

& =

<=

 

4.2 goto

1. C #

Goto

Goto <labelname>;

Tag definition:

<Labelname>:

// Code

 

4.3

1. Three branch technologies: ternary operators,

4.3.1

<Test>? <ResultTrue>: <resultFalse>

4.3.2 if

4.4.3switch

1. switch

2. After executing each part of the code, another statement is required.

3. In addition

4. if multiple

Switch

{

Case <comparisonVal1>:

Case <comparisonVal2>:

<Code to execute>;

Break;

......

}

5. Each

 

4.4

4.4.1 do... while

Execute the loop code and then perform a Boolean test. If the test result is

Do

{

<Code to be looped>

} While (<test> );

 

4.4.2 while

While

While

{
<Code to be looped>
}

 

 

4.4.3

This type of loop can execute a specified number of times and maintain its own counter.

For (<initialization >;< condition >;< operation>)

{

<Code to loop>

}

 

4.4.4

Notice

Use

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.