Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 83
1-
What will be the output of the program ?
#include<stdio.h>
#include<string.h>
int main()
{
char sentence[80];
int i;
printf("Enter a line of text\n");
gets(sentence);
for(i=strlen(sentence)-1; i >=0; i--)
putchar(sentence[i]);
return 0;
}
A -
The sentence will get printed in same order as it entered
In Turbo C/C++ under DOS if we want that any wild card characters in the command-line arguments should be appropriately expanded, are we required to make any special provision?
A -
Yes
B -
No
8-
Bitwise | can be used to multiply a number by powers of 2.
A -
Yes
B -
No
9-
What do the following declaration signify?
int *f();
A -
f is a pointer variable of function type.
B -
f is a function returning pointer to an int.
C -
f is a function pointer.
D -
f is a simple declaration of pointer variable.
10-
What will be the output of the program under DOS?
#include<stdio.h>
int main()
{
char huge *near *far *ptr1;
char near *far *huge *ptr2;
char far *huge *near *ptr3;
printf("%d, %d, %d\n", sizeof(ptr1), sizeof(**ptr2), sizeof(ptr3));
return 0;
}