vietjack.com

400 Câu hỏi trắc nghiệm lập trình C/C++ có đáp án (Phần 3)
Quiz

400 Câu hỏi trắc nghiệm lập trình C/C++ có đáp án (Phần 3)

A
Admin
50 câu hỏiIT TestTrắc nghiệm tổng hợp
50 CÂU HỎI
1. Nhiều lựa chọn

Maximum number of arguments that a function can take is 12

A. Yes

B. No

Xem giải thích câu trả lời
2. Nhiều lựa chọn

Usually recursion works slower than loops

A. Yes

B. No

Xem giải thích câu trả lời
3. Nhiều lựa chọn

In a function two return statements should never occur.

A. Yes

B. No

Xem giải thích câu trả lời
4. Nhiều lựa chọn

There is a error in the below program. Which statement will you add to remove it Media VietJack

A. Add prototype: float f(int, float);

B. Add prototype: float f(a, b);

C. Add prototype: float f(float a, int b)

Xem giải thích câu trả lời
5. Nhiều lựa chọn

Every function must return a value

A. Yes

B. No

Xem giải thích câu trả lời
6. Nhiều lựa chọn

Which of the following statements are correct about the program? Media VietJack

A. It prints garbage values infinitely

B. Runs infinitely without printing anything

C. Error: main( ) cannot be called inside printf( )

D. No Error and print nothing

Xem giải thích câu trả lời
7. Nhiều lựa chọn

Will the following functions work? Media VietJack

A. Yes

B. No

Xem giải thích câu trả lời
8. Nhiều lựa chọn

If a function contains two return statements successively, the complier will generate warnings. Yes / No?

A. Yes

B. No

Xem giải thích câu trả lời
9. Nhiều lựa chọn

Functions can not return a floating point number

A. Yes

B. No

Xem giải thích câu trả lời
10. Nhiều lựa chọn

What will be the output of the program? Media VietJack

A. 543210

B. 54321

C. 12345

D. Infinite loop

Xem giải thích câu trả lời
11. Nhiều lựa chọn

What will be the output of the program? Media VietJack

A. 4

B. 5

C. 6

D. Another

Xem giải thích câu trả lời
12. Nhiều lựa chọn

Point out a error of the following program Media VietJack

A. Missing parenthesis in return statement

B. The function should be defined as int f(int a, int b)

C. Re-declaration of a

D. None of above

Xem giải thích câu trả lời
13. Nhiều lựa chọn

Point out the error in the program Media VietJack

A. Error: Prototype declaration

B. No error

C. Error: return statement cannot be used with conditional operators

D. None of above

Xem giải thích câu trả lời
14. Nhiều lựa chọn

What will be the output of the program? Media VietJack

A. 6 6

B. 5 6

C. Complier error

D. None of above

Xem giải thích câu trả lời
15. Nhiều lựa chọn

What will be output of the program? Media VietJack

A. 4, 3, 4, 3

B. 4, 4, 5, 5

C. 3, 4, 3, 4

D. None of above

Xem giải thích câu trả lời
16. Nhiều lựa chọn

Which of the following statements are correct about this function Media VietJack

A. The function calculates the value of 1 raised to power n

B. The function calculates the factorial value of an integer

C. The function calculates the square root of an integer

D. None of above

Xem giải thích câu trả lời
17. Nhiều lựa chọn

Point out the error in the following program Media VietJack

A. Error: cannot convert ‘void’ to ‘int’

B. Error:

Xem giải thích câu trả lời
18. Nhiều lựa chọn

What will be output when you will execute following c code? Biết kích thước kiểu char : 1 byte, float : 4 byte, int : 4 byte, double : 8 byte, long : 4 byte. Media VietJack

A. 8 4 1

B. 8 2 1

C. 4 4 1

D. Depend on complier

Xem giải thích câu trả lời
19. Nhiều lựa chọn

What will be output when you will execute following c code? Media VietJack

A. 1 4 5

B. 1 4 7

C. 8 4 7

D. Another

Xem giải thích câu trả lời
20. Nhiều lựa chọn

What value gets printed by the program below? Media VietJack

A. 1

B. 0

C. 0.1

Xem giải thích câu trả lời
21. Nhiều lựa chọn

What will be output when you will execute following c code? Media VietJack

A. -6

B. 5

C. 4

D. Another

Xem giải thích câu trả lời
22. Nhiều lựa chọn

What will be output when you will execute following c code? Media VietJack

A. Avatar

B. Alien

C. Error at (*)

D. Another

Xem giải thích câu trả lời
23. Nhiều lựa chọn

What will be output when you will execute following c code? Media VietJack

A. 7

B. 8

C. 9

D. Another

Xem giải thích câu trả lời
24. Nhiều lựa chọn

What is output ? Media VietJack

A. 4

B. 0

C. 1

D. 5

Xem giải thích câu trả lời
25. Nhiều lựa chọn

What is output ? Media VietJack

A. 7

B. 6

C. 5

D. 1

Xem giải thích câu trả lời
26. Nhiều lựa chọn

What is output ? Media VietJack

A. 0

B. Error

C. 1

D. x isn’t defined

Xem giải thích câu trả lời
27. Nhiều lựa chọn

What is output ? Media VietJack

A. 0

B. 1

C. Error Comlier

Xem giải thích câu trả lời
28. Nhiều lựa chọn

What is output ? Media VietJack

A. 1 1

B. 1 0

C. ‘x’ undeclared identifier

Xem giải thích câu trả lời
29. Nhiều lựa chọn

Output of following code? Media VietJack

A. 1

B. 0

C. Error

Xem giải thích câu trả lời
30. Nhiều lựa chọn

Output of following code? Media VietJack

A. 1

B. Error

C. 0

Xem giải thích câu trả lời
31. Nhiều lựa chọn

Output of following code? Media VietJack

A. 0123456789

B. 0000000000

C. 0101010101

Xem giải thích câu trả lời
32. Nhiều lựa chọn

Output of following code? Media VietJack

A. 1

B. 5

C. 20

D. ‘x’ isn’t defined

Xem giải thích câu trả lời
33. Nhiều lựa chọn

What is output? Media VietJack

A. Garbage Garbage Garbage

B. 5 10 15

C. 15 10 5

D. Run time error

Xem giải thích câu trả lời
34. Nhiều lựa chọn

What is output? Media VietJack

A. c:/tc/bin/rw.c

B. c: c inw.c

C. c:cinw.c

D. w.c in

Xem giải thích câu trả lời
35. Nhiều lựa chọn

What is output ? Media VietJack

A. 5

B. 6

C. 0

D. Complier error

Xem giải thích câu trả lời
36. Nhiều lựa chọn

What is output? Media VietJack

A. 135

B. 8

C. -121

D. 121

Xem giải thích câu trả lời
37. Nhiều lựa chọn

What is output? Media VietJack

A. 12480

B. 1248@

C. 12500

D. 12522

Xem giải thích câu trả lời
38. Nhiều lựa chọn

What is output? Media VietJack

A. Hi

B. Hello

C. None of above

Xem giải thích câu trả lời
39. Nhiều lựa chọn

What is output of program? Media VietJack

A. i = 0

B. i = 1

C. Error

D. None of these

Xem giải thích câu trả lời
40. Nhiều lựa chọn

Which of the declaration is correct?

A. int length;

B. char int;

C. int long;

D. float double;

Xem giải thích câu trả lời
41. Nhiều lựa chọn

What is output of program? Media VietJack

A. N = 20

B. N = 10

C. Error

D. No Output

Xem giải thích câu trả lời
42. Nhiều lựa chọn

What is output of program? Media VietJack

A. 0 0 0

B. 1 2 2

C. 1 1 1

D. Error

Xem giải thích câu trả lời
43. Nhiều lựa chọn

What is output of program? Media VietJack

A. 3

B. 4

C. Complier Error

D. 3.14

Xem giải thích câu trả lời
44. Nhiều lựa chọn

Which of the following operations are INCORRECT?

A. int i = 35; i = i%5

B. short int j = 5; j = j;

C. long int k = 123L; k = k;

D. float a = 3.14; a = a%3;

Xem giải thích câu trả lời
45. Nhiều lựa chọn

Point out a error in the following program Media VietJack

A. Error: Declaration syntax error v (or) ‘v’: illegal use of type ‘void’

B. Program terminate abnormally

C. No error

D. None of these

Xem giải thích câu trả lời
46. Nhiều lựa chọn

In the following program how long will the for loop get executed? Media VietJack

A. The for loop would not get executed at all

B. The for loop would get executed only once

C. The for loop would get executed 5 times

D. The for loop would get executed infinite times

Xem giải thích câu trả lời
47. Nhiều lựa chọn

Point out the error in the following program (if it is compiled with Turbo C complier) Media VietJack

A. No error

B. display( ) is not declared

C. None of these

Xem giải thích câu trả lời
48. Nhiều lựa chọn

Which of the following are unary operators in C?
1. !
2. sizeof
3. ~
4. &&

A. 1, 2

B. 1, 3

C. 2, 4

D. 1, 2, 3

Xem giải thích câu trả lời
49. Nhiều lựa chọn

In the expression a = b = 5 the order of Assignment is NOT decided by Associativity of operators.

A. True

B. False

Xem giải thích câu trả lời
50. Nhiều lựa chọn

Which of the following is the correct order if calling functions in the below code? Media VietJack

A. f1, f2, f3

B. f3, f2, f1

C. Order may vary from complier to complier

D. None of above

Xem giải thích câu trả lời
© All rights reserved VietJack