Search Header Logo
Bài tập câu lệnh điều kiện (câu lệnh if)

Bài tập câu lệnh điều kiện (câu lệnh if)

Assessment

Presentation

Computers

8th Grade

Practice Problem

Medium

Created by

Hong Anh

Used 30+ times

FREE Resource

4 Slides • 11 Questions

1

Bài tập câu lệnh điều kiện (câu lệnh if)

Slide image

2

x := 3;   if  x > 10  then  x := x + 2;

Đáp án: 3

3

x := 3; if x > 10 then x := x + 2 else x:= x - 2;

Đáp án: 1

4

Nhắc nhở

Điều kiện trong câu lệnh điều kiện chỉ dùng để xét 1 lần duy nhất

5

Multiple Choice

x:=5;

if (45 mod 3 = 0) then x:=x+1;

1

5

2

6

3

7

4

8

6

Multiple Choice

x:=5;

if (45 mod 3 <> 0) then x:=x+1;

1

5

2

6

3

7

4

8

7

Multiple Choice

x := 5;

if (12 div 3 = 1) then x := x + 1 else x := x -1;

1

4

2

5

3

6

4

7

8

Multiple Choice

x := 5;

if (12 div 3 <> 1) then x := x + 1 else x := x -1;

1

4

2

5

3

6

4

7

9

Multiple Choice

x := 3; y := 4;

if (y mod x = 1) then x := x + y else x := x - y;

1

-1

2

1

3

-7

4

7

10

Multiple Choice

x := 3; y := 4;

if (y mod x <> 1) then x := x + y else x := x - y;

1

-1

2

1

3

-7

4

7

11

Multiple Choice

x := 3; y := 4;

if (y mod x <> 1) then x := x + y;

1

3

2

4

3

7

4

-1

12

Multiple Choice

x := 3;

if x > 10 then x := x + 2;

1

3

2

5

3

7

4

9

13

Multiple Choice

x := 3;

if x < 10 then x := x + 2;

1

3

2

5

3

7

4

9

14

Multiple Choice

x:=3; y:=5;

if (x + y) > 0 and (x - y) <> 0 then x := x + y else y := y - x;

1

2

2

3

3

5

4

8

15

Multiple Choice

x:=3; y:=5;

if (x + y) > 0 or (x - y) <> 0 then x := x + y else y := y - x;

1

2

2

3

3

5

4

8

Bài tập câu lệnh điều kiện (câu lệnh if)

Slide image

Show answer

Auto Play

Slide 1 / 15

SLIDE