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

2. Nhiều lựa chọn

Usually recursion works slower than loops

A. Yes

B. No

3. Nhiều lựa chọn

In a function two return statements should never occur.

A. Yes

B. No

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)

5. Nhiều lựa chọn

Every function must return a value

A. Yes

B. No

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

7. Nhiều lựa chọn

Will the following functions work? Media VietJack

A. Yes

B. No

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

9. Nhiều lựa chọn

Functions can not return a floating point number

A. Yes

B. No

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

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

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

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

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

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

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

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:

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

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

20. Nhiều lựa chọn

What value gets printed by the program below? Media VietJack

A. 1

B. 0

C. 0.1

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

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

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

24. Nhiều lựa chọn

What is output ? Media VietJack

A. 4

B. 0

C. 1

D. 5

25. Nhiều lựa chọn

What is output ? Media VietJack

A. 7

B. 6

C. 5

D. 1

26. Nhiều lựa chọn

What is output ? Media VietJack

A. 0

B. Error

C. 1

D. x isn’t defined

27. Nhiều lựa chọn

What is output ? Media VietJack

A. 0

B. 1

C. Error Comlier

28. Nhiều lựa chọn

What is output ? Media VietJack

A. 1 1

B. 1 0

C. ‘x’ undeclared identifier

29. Nhiều lựa chọn

Output of following code? Media VietJack

A. 1

B. 0

C. Error

30. Nhiều lựa chọn

Output of following code? Media VietJack

A. 1

B. Error

C. 0

31. Nhiều lựa chọn

Output of following code? Media VietJack

A. 0123456789

B. 0000000000

C. 0101010101

32. Nhiều lựa chọn

Output of following code? Media VietJack

A. 1

B. 5

C. 20

D. ‘x’ isn’t defined

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

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

35. Nhiều lựa chọn

What is output ? Media VietJack

A. 5

B. 6

C. 0

D. Complier error

36. Nhiều lựa chọn

What is output? Media VietJack

A. 135

B. 8

C. -121

D. 121

37. Nhiều lựa chọn

What is output? Media VietJack

A. 12480

B. 1248@

C. 12500

D. 12522

38. Nhiều lựa chọn

What is output? Media VietJack

A. Hi

B. Hello

C. None of above

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

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;

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

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

43. Nhiều lựa chọn

What is output of program? Media VietJack

A. 3

B. 4

C. Complier Error

D. 3.14

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;

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

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

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

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

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

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

© All rights reserved VietJack