700+ câu trắc nghiệm Ngôn ngữ lập trình C có đáp án - Phần 6
Đề thi

700+ câu trắc nghiệm Ngôn ngữ lập trình C có đáp án - Phần 6

A
Admin
Đại họcTrắc nghiệm tổng hợp48 lượt thi
25 câu hỏi
1. Trắc nghiệm
• 1 điểm

Which is not a proper prototype?

int funct(char x, char y);

double funct(char x)

void funct();

char x();

Xem đáp án

Chọn đáp án B

2. Trắc nghiệm
• 1 điểm

What is the return type of the function with prototype: “int func(char x, float v, double t);”

char

int

float

double

Xem đáp án

Chọn đáp án B

3. Trắc nghiệm
• 1 điểm

Which of the following is a valid function call (assuming the function exists)?

funct;

funct x, y;

funct();

int funct();

Xem đáp án

Chọn đáp án C

4. Trắc nghiệm
• 1 điểm

Which of the following is a complete function?

int funct();

int funct(int x) {return x=x+1;}

void funct(int) {printf( “Hello” );

void funct(x) {printf( “Hello” ); }

Xem đáp án

Chọn đáp án B

5. Trắc nghiệm
• 1 điểm

What is required to avoid falling through from one case to the next?

end;

break;

stop;

continue;

Xem đáp án

Chọn đáp án B

6. Trắc nghiệm
• 1 điểm

What keyword covers unhandled possibilities?

all

continue

default

other

Xem đáp án

Chọn đáp án C

7. Trắc nghiệm
• 1 điểm

What is the result of the following code? void main() { int x = 0; switch(x) { case 1: printf( "One" ); case 0: printf( "Zero" ); case 2: printf( "Hello World" ); } }

One

Zero

Hello World

ZeroHello World

Xem đáp án

Chọn đáp án A

8. Trắc nghiệm
• 1 điểm

Which of the following is the proper declaration of a pointer?

int x;

int &x;

ptr x;

int *x;

Xem đáp án

Chọn đáp án D

9. Trắc nghiệm
• 1 điểm

Which of the following gives the memory address of integer variable a?

*a;

a;

&a;

address(a);

Xem đáp án

Chọn đáp án C

10. Trắc nghiệm
• 1 điểm

Which of the following gives the memory address of a variable pointed to by pointer a?

a;

*a;

&a;

address(a);

Xem đáp án

Chọn đáp án A

11. Trắc nghiệm
• 1 điểm

Which of the following gives the value stored at the address pointed to by pointer a?

a;

val(a);

*a;

&a;

Xem đáp án

Chọn đáp án C

12. Trắc nghiệm
• 1 điểm

Which of the following is the proper keyword or function to allocate memory in C?

new

malloc

create

value

Xem đáp án

Chọn đáp án B

13. Trắc nghiệm
• 1 điểm

Which of the following is the proper keyword or function to deallocate memory in C language?

free

delete

clear

remove

Xem đáp án

Chọn đáp án B

14. Trắc nghiệm
• 1 điểm

Which of the following accesses a variable in structure b?

b→var;

b>var;

b-var;

b>var;

Xem đáp án

Chọn đáp án B

15. Trắc nghiệm
• 1 điểm

Which of the following accesses a variable in a pointer to a structure, *b?

b→var;

b-var;

b>var;

b>var;

Xem đáp án

Chọn đáp án A

16. Trắc nghiệm
• 1 điểm

Which of the following is a properly defined struct?

struct {int a;}

struct a_struct {int a;}

struct a_struct int a;

struct a_struct {int a;};

Xem đáp án

Chọn đáp án D

17. Trắc nghiệm
• 1 điểm

Which properly declares a variable of struct foo?

struct foo;

struct foo var;

foo;

int foo;

Xem đáp án

Chọn đáp án B

18. Trắc nghiệm
• 1 điểm

Which of the following correctly declares an array?

int arr[10];

int arr;

arr{10};

array arr[10];

Xem đáp án

Chọn đáp án A

19. Trắc nghiệm
• 1 điểm

What is the index number of the last element of an array with 29 elements?

29

28

0

Programmer-defined

Xem đáp án

Chọn đáp án B

20. Trắc nghiệm
• 1 điểm

Which of the following is a two-dimensional array?

array arr[20][20];

int arr[20][20];

int arr[20, 20];

char arr[20];

Xem đáp án

Chọn đáp án B

21. Trắc nghiệm
• 1 điểm

Which of the following correctly accesses the seventh element stored in foo, an array with 100 elements?

foo[6];

foo[7];

foo(7);

foo;

Xem đáp án

Chọn đáp án A

22. Trắc nghiệm
• 1 điểm

Which of the following gives the memory address of the first element in array arr, an array with 100 elements?

arr[0];

arr;

&arr;

arr[1];

Xem đáp án

Chọn đáp án B

23. Trắc nghiệm
• 1 điểm

Which of the following is a string literal?

Static String

“Static String”

‘Static String’

char string[100];

Xem đáp án

Chọn đáp án B

24. Trắc nghiệm
• 1 điểm

What character ends all strings?

‘.’

‘ ‘

‘\0’

‘/0’

Xem đáp án

Chọn đáp án C

25. Trắc nghiệm
• 1 điểm

Which of the following reads in a string named x with one hundred characters?

fgets(x, 101, stdin);

fgets(x, 100, stdin);

readline(x, 100, ‘\n’);

read(x);

Xem đáp án

Chọn đáp án B

Bạn có thích hoạt động này không?

Bắt đầu ngay
Khám phá các nguồn tài nguyên miễn phí, phù hợp với tiêu chuẩn trong vài giây
Giải tích 1Giải tích 2Giải tích 3Cơ học kĩ thuậtKiến thức máy tínhNgôn ngữ lập trình CKĩ thuật đoTruyền động điệnKỹ thuật đo lườngNgắn mạch trong Hệ thống điệnToán tài chính đại cươngLý luận TDTTHóa lýHệ điều hành Unix (Linux)Kỹ thuật vi xử lýQuá trình và thiết bị chuyển khối (Hóa công 3)Quá trình và thiết bị truyền nhiệt (Hóa công 2)Phân tích thành phần lý hóa thực phẩmMáy điện IAnten và Truyền SóngCông nghệ Web và dịch vụ trực tuyếnHệ Điều hànhLuật hàng khôngLinux và phần mềm mã nguồn mởCấu tạo ô tôChế tạo phôiMáy nâng chuyểnCông nghệ khung vỏ ô tôCấu trúc máy tínhThông tin di độngThiết kế VLSIHệ thống thông tin y tếCông nghệ sản xuất giấyCông nghệ sinh học trong hoá dượcHoá dược & KT tổng hợp 1Bơm quạt máy nénKỹ thuật mạngTương tác Người – MáyPhân tích yêu cầu phần mềmQuản trị cơ sở dữ liệu phân tánNgôn ngữ mô hình hóa UMLCác kỹ thuật chuyển mạchKỹ thuật cháyCông nghệ lên men công nghiệpCông nghệ sinh học thực vậtHóa học IIQuá trình và thiết bị cơ họcKĩ thuật thủy khíKĩ thuật điện tử sốMáy điện 2Thiết bị điệnCơ sở tự động hóaCung cấp điệnHệ thống thông tin công nghiệpLý thuyết thông tinXử lý số tín hiệuCơ sở đo lường điện tửProfessional skillsNhững NLCB của CN Mác-Lênin I (Tự luận)Tư tưởng Hồ Chí Minh (Tự luận)Đường lối CM của Đảng CSVN (Tự luận)Pháp luật đại cương (Tự luận)Bơi lội (Tự luận)Đường lối quân sự của Đảng (Tự luận)Công tác quốc phòng, an ninh (Tự luận)