Tài liệu Chapter 5 Quick Reference pdf

1 266 0
Tài liệu Chapter 5 Quick Reference pdf

Đang tải... (xem toàn văn)

Thông tin tài liệu

Chapter 5 Quick Reference To Do this Add an amount to a variable Use the compound addition operator. For example: variable += amount; Subtract an amount from a variable Use the compound subtraction operator. For example: variable -= amount; Run one or more statements while a condition is true Use a while statement. For example: int i = 0; while (i != 10) { Console.WriteLine(i); i++; } Alternatively, use a for statement. For example: for (int i = 0; i != 10; i++) { Console.WriteLine(i); } Repeatedly execute statements one or more times Use a do statement. For example: int i = 0; do { Console.WriteLine(i); i++; } while (i != 10); . Chapter 5 Quick Reference To Do this Add an amount to a variable Use the compound

Ngày đăng: 21/01/2014, 15:20

Tài liệu cùng người dùng

Tài liệu liên quan