1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu Chapter 4 Quick Reference ppt

1 269 0
Tài liệu đã được kiểm tra trùng lặp

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

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề To determine whether two values are equivalent
Định dạng
Số trang 1
Dung lượng 6,84 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Chapter 4 Quick Reference Determine whether two values are equivalent Use the == or != Compare the value of two expressions Use the = Declare a Boolean variable Use the bool keyword as t

Trang 1

Chapter 4 Quick Reference

Determine whether two values are

equivalent

Use the == or !=

Compare the value of two

expressions

Use the <, <=, >, or >=

Declare a Boolean variable

Use the bool keyword

as the type of the variable

bool inRange;

Create a Boolean expression that is

true only if two other conditions

are true

&& (number <= hi);

Create a Boolean expression that is

true if either of two other

conditions is true

|| (hi < number);

Run a statement if a condition is

if (inRange) process();

Run more than one statement if a

if (seconds == 59) {

seconds = 0;

minutes++;

}

Associate different statements with

different values of a controlling

expression

Use a switch statement

switch (current) {

case '<':

break;

default :

break;

}

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