Danh mục tài liệu

Chapter 5 Quick Reference

Số trang: 1      Loại file: pdf      Dung lượng: 6.51 KB      Lượt xem: 16      Lượt tải: 0    
Xem trước 1 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Chương 5 Quick tham khảo để Thêm một số tiền để biến mộtLàm điều này sử dụng các nhà điều hành bổ sung hợp chất. Ví dụ: số tiền biến + =; Sử dụng toán tử trừ hợp chất.
Nội dung trích xuất từ tài liệu:
Chapter 5 Quick Reference Chapter 5 Quick ReferenceTo Do this Use the compound addition operator. For example:Add an amount to a variable variable += amount; Use the compound subtraction operator. For example:Subtract an amount from a variable variable -= amount; Use a while statement. For example: int i = 0; while (i != 10) { Console.WriteLine(i); i++;Run one or more statements while a }condition is true Alternatively, use a for statement. For example: for (int i = 0; i != 10; i++) { Console.WriteLine(i); } Use a do statement. For example: int i = 0; doRepeatedly execute statements one or {more times Console.WriteLine(i); i++; } while (i != 10);