Câu hỏi trắc nghiệm ngôn ngữ lập trình C (tiếp theo)
Code:
int x[] = { 1, 4, 8, 5, 1, 4 };
int *ptr, y;
ptr = x + 4;
y = ptr - x;
What does y in the sample code above equal?
Choice 1
-3
Choice 2
0
Choice 3
4[Ans]
Choice 4
4 + sizeof( int )
Choice 5
4 * sizeof( int
Q27:
Code:
void myFunc (int x)
{
if (x > 0)
myFunc(--x);
printf("%d, ", x);
}
int main()
{
myFunc(5);
return 0;
}
What will the above sample code produce when executed?
Choice 1
1, 2, 3, 4, 5, 5,
Choice 2
4, 3, 2, 1, 0, 0,
Choice 3
5, 4, 3, 2, 1, 0,
Choice 4
0, 0, 1, 2, 3, 4,
Choice 5
0, 1, 2, 3, 4, 5,
Q28:
11 ^ 5
What does the operation shown above produce?
Choice 1
1
Choice 2
6
Choice 3
8
Choice 4
14
Choice 5
15
Q29:
#define MAX_NUM 15
Referring to the sample above, what is MAX_NUM?
Choice 1
MAX_NUM is an integer variable.
Choice 2
MAX_NUM is a linker constant.
Choice 3
MAX_NUM is a precompiler constant.
Choice 4
MAX_NUM is a preprocessor macro.
Choice 5
MAX_NUM is an integer constant.
Q30:
Which one of the following will turn off buffering for stdout?
Choice 1
setbuf( stdout, FALSE );
Choice 2
setvbuf( stdout, NULL );
Choice 3
setbuf( stdout, NULL );
Choice 4
setvbuf( stdout, _IONBF );
Choice 5
setbuf( stdout, _IONBF );
NGUYỄN THỊ BẢO TRANG
» Tin mới nhất:
» Các tin khác: