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

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

A
Admin
IT TestTrắc nghiệm tổng hợp70 lượt thi
50 câu hỏi
1. Trắc nghiệm
1 điểm

Maximum number of arguments that a function can take is 12

Yes

No

Xem đáp án

Chọn B

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

Usually recursion works slower than loops

Yes

No

Xem đáp án

Chọn A

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

In a function two return statements should never occur.

Yes

No

Xem đáp án

Chọn B

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

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

Add prototype: float f(int, float);

Add prototype: float f(a, b);

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

Xem đáp án

Chọn A

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

Every function must return a value

Yes

No

Xem đáp án

Chọn B

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

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

It prints garbage values infinitely

Runs infinitely without printing anything

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

No Error and print nothing

Xem đáp án

Chọn B

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

Will the following functions work?Media VietJack

Yes

No

Xem đáp án

Chọn B

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

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

Yes

No

Xem đáp án

Chọn B

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

Functions can not return a floating point number

Yes

No

Xem đáp án

Chọn B

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

What will be the output of the program?Media VietJack

543210

54321

12345

Infinite loop

Xem đáp án

Chọn D

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

What will be the output of the program?Media VietJack

4

5

6

Another

Xem đáp án

Chọn A

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

Point out a error of the following programMedia VietJack

Missing parenthesis in return statement

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

Re-declaration of a

None of above

Xem đáp án

Chọn B

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

Point out the error in the programMedia VietJack

Error: Prototype declaration

No error

Error: return statement cannot be used with conditional operators

None of above

Xem đáp án

Chọn C

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

What will be the output of the program?Media VietJack

6 6

5 6

Complier error

None of above

Xem đáp án

Chọn A

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

What will be output of the program?Media VietJack

4, 3, 4, 3

4, 4, 5, 5

3, 4, 3, 4

None of above

Xem đáp án

Chọn A

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

Which of the following statements are correct about this functionMedia VietJack

The function calculates the value of 1 raised to power n

The function calculates the factorial value of an integer

The function calculates the square root of an integer

None of above

Xem đáp án

Chọn B

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

Point out the error in the following programMedia VietJack

Error: cannot convert ‘void’ to ‘int’

Error:

Xem đáp án

Chọn A

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

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

8 4 1

8 2 1

4 4 1

Depend on complier

Xem đáp án

Chọn A

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

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

1 4 5

1 4 7

8 4 7

Another

Xem đáp án

Chọn A

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

What value gets printed by the program below?Media VietJack

1

0

0.1

Xem đáp án

Chọn B

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

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

-6

5

4

Another

Xem đáp án

Chọn A

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

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

Avatar

Alien

Error at (*)

Another

Xem đáp án

Chọn A

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

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

7

8

9

Another

Xem đáp án

Chọn B

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

What is output ?Media VietJack

4

0

1

5

Xem đáp án

Chọn A

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

What is output ?Media VietJack

7

6

5

1

Xem đáp án

Chọn A

26. Trắc nghiệm
1 điểm

What is output ?Media VietJack

0

Error

1

x isn’t defined

Xem đáp án

Chọn C

27. Trắc nghiệm
1 điểm

What is output ?Media VietJack

0

1

Error Comlier

Xem đáp án

Chọn A

28. Trắc nghiệm
1 điểm

What is output ?Media VietJack

1 1

1 0

‘x’ undeclared identifier

Xem đáp án

Chọn C

29. Trắc nghiệm
1 điểm

Output of following code?Media VietJack

1

0

Error

Xem đáp án

Chọn C

30. Trắc nghiệm
1 điểm

Output of following code?Media VietJack

1

Error

0

Xem đáp án

Chọn C

31. Trắc nghiệm
1 điểm

Output of following code?Media VietJack

0123456789

0000000000

0101010101

Xem đáp án

Chọn A

32. Trắc nghiệm
1 điểm

Output of following code?Media VietJack

1

5

20

‘x’ isn’t defined

Xem đáp án

Chọn B

33. Trắc nghiệm
1 điểm

What is output?Media VietJack

Garbage Garbage Garbage

5 10 15

15 10 5

Run time error

Xem đáp án

Chọn A

34. Trắc nghiệm
1 điểm

What is output?Media VietJack

c:/tc/bin/rw.c

c: c inw.c

c:cinw.c

w.c in

Xem đáp án

Chọn D

35. Trắc nghiệm
1 điểm

What is output ?Media VietJack

5

6

0

Complier error

Xem đáp án

Chọn D

36. Trắc nghiệm
1 điểm

What is output?Media VietJack

135

8

-121

121

Xem đáp án

Chọn C

37. Trắc nghiệm
1 điểm

What is output?Media VietJack

12480

1248@

12500

12522

Xem đáp án

Chọn A

38. Trắc nghiệm
1 điểm

What is output?Media VietJack

Hi

Hello

None of above

Xem đáp án

Chọn A

39. Trắc nghiệm
1 điểm

What is output of program?Media VietJack

i = 0

i = 1

Error

None of these

Xem đáp án

Chọn B

40. Trắc nghiệm
1 điểm

Which of the declaration is correct?

int length;

char int;

int long;

float double;

Xem đáp án

Chọn A

41. Trắc nghiệm
1 điểm

What is output of program?Media VietJack

N = 20

N = 10

Error

No Output

Xem đáp án

Chọn A

42. Trắc nghiệm
1 điểm

What is output of program?Media VietJack

0 0 0

1 2 2

1 1 1

Error

Xem đáp án

Chọn A

43. Trắc nghiệm
1 điểm

What is output of program?Media VietJack

3

4

Complier Error

3.14

Xem đáp án

Chọn B

44. Trắc nghiệm
1 điểm

Which of the following operations are INCORRECT?

int i = 35; i = i%5

short int j = 5; j = j;

long int k = 123L; k = k;

float a = 3.14; a = a%3;

Xem đáp án

Chọn D

45. Trắc nghiệm
1 điểm

Point out a error in the following programMedia VietJack

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

Program terminate abnormally

No error

None of these

Xem đáp án

Chọn A

46. Trắc nghiệm
1 điểm

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

The for loop would not get executed at all

The for loop would get executed only once

The for loop would get executed 5 times

The for loop would get executed infinite times

Xem đáp án

Chọn D

47. Trắc nghiệm
1 điểm

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

No error

display( ) is not declared

None of these

Xem đáp án

Chọn B

48. Trắc nghiệm
1 điểm

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

1, 2

1, 3

2, 4

1, 2, 3

Xem đáp án

Chọn D

49. Trắc nghiệm
1 điểm

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

True

False

Xem đáp án

Chọn B

50. Trắc nghiệm
1 điểm

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

f1, f2, f3

f3, f2, f1

Order may vary from complier to complier

None of above

Xem đáp án

Chọn C