400 Câu hỏi trắc nghiệm lập trình C/C++ có đáp án (Phần 5)
50 câu hỏi
What is output?
Hey
5
5Hey
Complie error
What is output?
1 4
1 2 3 4
Syntax error
Syntax error
What is output?\
Complie error
3
1
1 3
What is output?
loop loop loop
Infinite loop
Complie error
What is output?
True
False
Complier Error
Run time error
What is output?
A
B
ABC
What is output?
A
B
ABC
What is output?
FALSE
TRUE
Default
What is output?
3
5
03
05
What is output?
3
4
5
6
What is output?
x = 2
x = 6
x = 0
What is output?
ABC
BC
B
Complier Error
What is output of code?
ABC
DEF
Syntax error
What is output of code?
Equal
Unequal
nothing is printed
What is output of code?
True
False
Complier error
What is output of code?
True
False
Complier error
What is output of code?
True
False
Complier error
What is output of code?
2468101214161820
468101214161820
nothing is printed
What is output of code?
C/C++ 15
Java 15
Java 5
Complier error
What is output of code?
C/C++ 80
C/C++ 81
Java 80
Java 81
What is output of code?
1 12
2 12
2 11
What is output ?
hello_World
ello_World
llo_World
lo_World
What is output?
hello_World
ello_World
llo_World
lo_World
What is output?
3
4
5
6
What is output?
10#15
10#10
15#15
11#15
What is output of following code?
4#4
4#5
5#6
4#6
What is output of following code?
400 2
400 400
400 401
Complier error
What is output?
pvpit
vpit
v
Another
What is output?
5
7
9
10
For the code below which lines should be reported as errors by a compiler?
1
2
3
None of the lines
What is output?
Complier error
6
5
Another
What is output?
5
6
8
Complier Error
What is output of code?
4
5
6
Complier Error
What is output of code?
320
64
Complier Error
What will be output of following program?
Address of j , Address of i , 3
Complier Error
3 , 3 , 3
What will be output of following program?
printf("\n%d", ptr2);
strcpy(ptr1, "c");
strcpy(ptr2, "questions");
printf("\n%s %s", ptr1, ptr2);
What will be output of following program?
int a = 10;
void *p = &a;
int *ptr = p;
printf("%u\n", *ptr);
What will be output of following program?
3
4
5
6
What will be output of following program?
5 5
Complier Error
5 Garbage value
What will be output of following program?
Address of i Address of i
Garbage value Garbage value
Complier Error
What is output?
6
7
8
9
What is output?
I
E
M
N
What will be output of following program?
37363534
34353637
45673333
What is output?
11
12
Garbage value
Complier error
Which of the following statements are correct about an array?
1. The array int num[26]; can store 26 elements
2. The expression num[1] designates the very first element in the array
3. It is necessary to initialize the array at the time of declaration.
4. The declaration num[SIZE] is allowed if SIZE is a macro.
1,4
3
1,2
1
The library function used to find the last occurrence of a character in a string is
strnstr()
strrchr()
laststr()
strstr()
What is output? (assuming that the array begins at the location 1002 and size of an integer is 4 bytes)
1006, 2, 2
1006, 4, 4
1002, 5, 5
Error
What does the following declaration mean?
ptr is array of pointers to 10 integers
ptr is a pointer to an array of 10 integers
ptr is an array of 10 integers
ptr is an pointer to array
What is output?
LAPTRINHC++
LAPTRINHC++\0\.NET\0
LAPTRINHC++\0\.NET
What is output?
LAPTRINHC++.NET
NETLAPTRINHC++
Address of pstr[0] Address of pstr[1]







