2048.vn

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
IT TestTrắc nghiệm tổng hợp8 lượt thi
50 câu hỏi
1. Trắc nghiệm
1 điểmKhông giới hạn

Maximum number of arguments that a function can take is 12

Yes

No

Xem đáp án
2. Trắc nghiệm
1 điểmKhông giới hạn

Usually recursion works slower than loops

Yes

No

Xem đáp án
3. Trắc nghiệm
1 điểmKhông giới hạn

In a function two return statements should never occur.

Yes

No

Xem đáp án
4. Trắc nghiệm
1 điểmKhông giới hạn

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
5. Trắc nghiệm
1 điểmKhông giới hạn

Every function must return a value

Yes

No

Xem đáp án
6. Trắc nghiệm
1 điểmKhông giới hạn

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
7. Trắc nghiệm
1 điểmKhông giới hạn

Will the following functions work?Media VietJack

Yes

No

Xem đáp án
8. Trắc nghiệm
1 điểmKhông giới hạn

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

Yes

No

Xem đáp án
9. Trắc nghiệm
1 điểmKhông giới hạn

Functions can not return a floating point number

Yes

No

Xem đáp án
10. Trắc nghiệm
1 điểmKhông giới hạn

What will be the output of the program?Media VietJack

543210

54321

12345

Infinite loop

Xem đáp án
11. Trắc nghiệm
1 điểmKhông giới hạn

What will be the output of the program?Media VietJack

4

5

6

Another

Xem đáp án
12. Trắc nghiệm
1 điểmKhông giới hạn

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
13. Trắc nghiệm
1 điểmKhông giới hạn

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
14. Trắc nghiệm
1 điểmKhông giới hạn

What will be the output of the program?Media VietJack

6 6

5 6

Complier error

None of above

Xem đáp án
15. Trắc nghiệm
1 điểmKhông giới hạn

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
16. Trắc nghiệm
1 điểmKhông giới hạn

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
17. Trắc nghiệm
1 điểmKhông giới hạn

Point out the error in the following programMedia VietJack

Error: cannot convert ‘void’ to ‘int’

Error:

Xem đáp án
18. Trắc nghiệm
1 điểmKhông giới hạ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

8 4 1

8 2 1

4 4 1

Depend on complier

Xem đáp án
19. Trắc nghiệm
1 điểmKhông giới hạn

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
20. Trắc nghiệm
1 điểmKhông giới hạn

What value gets printed by the program below?Media VietJack

1

0

0.1

Xem đáp án
21. Trắc nghiệm
1 điểmKhông giới hạn

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

-6

5

4

Another

Xem đáp án
22. Trắc nghiệm
1 điểmKhông giới hạn

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

Avatar

Alien

Error at (*)

Another

Xem đáp án
23. Trắc nghiệm
1 điểmKhông giới hạn

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

7

8

9

Another

Xem đáp án
24. Trắc nghiệm
1 điểmKhông giới hạn

What is output ?Media VietJack

4

0

1

5

Xem đáp án
25. Trắc nghiệm
1 điểmKhông giới hạn

What is output ?Media VietJack

7

6

5

1

Xem đáp án
26. Trắc nghiệm
1 điểmKhông giới hạn

What is output ?Media VietJack

0

Error

1

x isn’t defined

Xem đáp án
27. Trắc nghiệm
1 điểmKhông giới hạn

What is output ?Media VietJack

0

1

Error Comlier

Xem đáp án
28. Trắc nghiệm
1 điểmKhông giới hạn

What is output ?Media VietJack

1 1

1 0

‘x’ undeclared identifier

Xem đáp án
29. Trắc nghiệm
1 điểmKhông giới hạn

Output of following code?Media VietJack

1

0

Error

Xem đáp án
30. Trắc nghiệm
1 điểmKhông giới hạn

Output of following code?Media VietJack

1

Error

0

Xem đáp án
31. Trắc nghiệm
1 điểmKhông giới hạn

Output of following code?Media VietJack

0123456789

0000000000

0101010101

Xem đáp án
32. Trắc nghiệm
1 điểmKhông giới hạn

Output of following code?Media VietJack

1

5

20

‘x’ isn’t defined

Xem đáp án
33. Trắc nghiệm
1 điểmKhông giới hạn

What is output?Media VietJack

Garbage Garbage Garbage

5 10 15

15 10 5

Run time error

Xem đáp án
34. Trắc nghiệm
1 điểmKhông giới hạn

What is output?Media VietJack

c:/tc/bin/rw.c

c: c inw.c

c:cinw.c

w.c in

Xem đáp án
35. Trắc nghiệm
1 điểmKhông giới hạn

What is output ?Media VietJack

5

6

0

Complier error

Xem đáp án
36. Trắc nghiệm
1 điểmKhông giới hạn

What is output?Media VietJack

135

8

-121

121

Xem đáp án
37. Trắc nghiệm
1 điểmKhông giới hạn

What is output?Media VietJack

12480

1248@

12500

12522

Xem đáp án
38. Trắc nghiệm
1 điểmKhông giới hạn

What is output?Media VietJack

Hi

Hello

None of above

Xem đáp án
39. Trắc nghiệm
1 điểmKhông giới hạn

What is output of program?Media VietJack

i = 0

i = 1

Error

None of these

Xem đáp án
40. Trắc nghiệm
1 điểmKhông giới hạn

Which of the declaration is correct?

int length;

char int;

int long;

float double;

Xem đáp án
41. Trắc nghiệm
1 điểmKhông giới hạn

What is output of program?Media VietJack

N = 20

N = 10

Error

No Output

Xem đáp án
42. Trắc nghiệm
1 điểmKhông giới hạn

What is output of program?Media VietJack

0 0 0

1 2 2

1 1 1

Error

Xem đáp án
43. Trắc nghiệm
1 điểmKhông giới hạn

What is output of program?Media VietJack

3

4

Complier Error

3.14

Xem đáp án
44. Trắc nghiệm
1 điểmKhông giới hạn

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
45. Trắc nghiệm
1 điểmKhông giới hạn

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
46. Trắc nghiệm
1 điểmKhông giới hạn

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
47. Trắc nghiệm
1 điểmKhông giới hạn

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
48. Trắc nghiệm
1 điểmKhông giới hạn

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
49. Trắc nghiệm
1 điểmKhông giới hạn

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

True

False

Xem đáp án
50. Trắc nghiệm
1 điểmKhông giới hạn

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
© All rights reserved VietJack