CTDL&TG_Buoi1

CTDL&TG_Buoi1

University

100 Qs

quiz-placeholder

Similar activities

Control Statements and Looping

Control Statements and Looping

University

99 Qs

MOCK QUIZ 2 Quation Solutions Private Limited

MOCK QUIZ 2 Quation Solutions Private Limited

University

100 Qs

AlgoritmUwUsok és adatszerkezetek I. Vizsga

AlgoritmUwUsok és adatszerkezetek I. Vizsga

University

96 Qs

OOP Final Exam

OOP Final Exam

University

100 Qs

Python Basics

Python Basics

University

100 Qs

Thiết kế web_Buổi 8

Thiết kế web_Buổi 8

University

100 Qs

Làm cho bà bạn tui !!!!

Làm cho bà bạn tui !!!!

University

100 Qs

ACO.2024.Chapter 3

ACO.2024.Chapter 3

University

100 Qs

CTDL&TG_Buoi1

CTDL&TG_Buoi1

Assessment

Quiz

Computers

University

Medium

Created by

Thắng Quốc

Used 1+ times

FREE Resource

100 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Đâu là cách khai báo một biến số nguyên hợp lệ trong C++?
integer x;
int x;
x : int;
declare x as int;

Answer explanation

Trong C++, từ khóa 'int' được sử dụng để khai báo một biến kiểu số nguyên.

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Kết quả của đoạn code sau là gì: `int x = 5; int y = 2; cout << x / y;`
2.5
2
3
Lỗi biên dịch

Answer explanation

Phép chia giữa hai số nguyên sẽ cho kết quả là một số nguyên (phần nguyên của kết quả), vì vậy 5 chia cho 2 sẽ được 2.

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Toán tử nào được sử dụng để truy cập địa chỉ của một biến?
*
&
@
#

Answer explanation

Toán tử '&' (address-of) được sử dụng để lấy địa chỉ bộ nhớ của một biến.

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Dòng nào sau đây sẽ in ra "Hello, World!" và xuống dòng mới?
cout << "Hello, World!" << endl;
cout << "Hello, World!";
printf("Hello, World!\n");
System.out.println("Hello, World!");

Answer explanation

`endl` trong C++ không chỉ xuống dòng mà còn xóa bộ đệm (flush buffer), đảm bảo nội dung được in ra ngay lập tức.

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Kiểu dữ liệu nào phù hợp nhất để lưu trữ giá trị `true` hoặc `false`?
int
char
string
bool

Answer explanation

Kiểu dữ liệu 'bool' (boolean) được thiết kế chuyên để lưu trữ các giá trị logic là true hoặc false.

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Vòng lặp nào trong C++ sẽ thực thi khối lệnh ít nhất một lần?
for
while
do-while
if

Answer explanation

Vòng lặp 'do-while' kiểm tra điều kiện ở cuối vòng lặp, do đó khối lệnh bên trong nó luôn được thực thi ít nhất một lần.

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Làm thế nào để viết một dòng chú thích trong C++?
// Chú thích
/* Chú thích */
# Chú thích

Answer explanation

Ký tự '//' được sử dụng để bắt đầu một chú thích trên một dòng. Mọi thứ từ sau '//' đến cuối dòng sẽ bị trình biên dịch bỏ qua.

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?