Beruflich Dokumente
Kultur Dokumente
1. main()
{
printf(\n%d %d %d ,sizeof(3),sizeof(3),sizeof(3));
}
a. 1 1 1
c. 1 2 2
b. 2 2 2
d. Compiler Dependent
void
void
void
void
(funptr)(char *)
* (funptr)(char *)
* (*funptr)(char)
* (*funptr)(char *)
main()
{
const int x=5;
int *ptrx;
ptrx = &x;
*ptrx = 10;
printf(%d,x);
}
A.5
B.10
C. Error
D. Garbage value
}
A. 5 5 5 5
B. Cannot convert int to int *
C. Invalid indirection
D. Both B and C
6. If we ask realloc to increase the allocated space, would it increase the space at the
same location or would it try to find a different place?
A.
B.
C.
D.
Same place
Different place
First try at the same place than if not possible at different place.
will not increase the space itself
7.
main()
{
int a=10,*j;
void *k;
j=k=&a;
j++;
k++;
printf(%u %u,j,k);
}
A. 11 11
C.11 10
8. Specify the output of the program if compiled and run under linux
main()
{
int *ptr=NULL;
printf(%d,*ptr);
}
A.
B.
C.
D.
Local Variables
Static Variables
Extern Variables
Volatile Variables
char *p = "string";
A. Nothing
12.
13.
49
56
81
Compiler dependent
}
A.
B.
C.
D.
0x00010000
Program terminates
0x00000000
Compile Time Error
19.
A.
B.
C.
D.
Nothing wrong
We cannot use a constant value inside malloc
*p must be replaced by p
Both B and C
A
B
C
Garbage value
i=0
i<=10
i++
All of the above
25. Which one out of NULL and 0 should be used to initialize pointers?
A. NULL
B. 0
C. None
D. Either; the distinction is entirely stylistic
26. In what way out of the following the Post order traversal mechanism
can be best used for
28.
Out of the following searching algorithms follows the divide and conquer
strategy
A.
B.
C.
D.
29.
Left->Root->Right
Root->Left->Right
Left->Right->Root
Root->Right->Left
Sequential search
Binary Search
Linear Search
Selection Search
Which of the following sorting algorithms uses the divide and conquer strategy
A.
B.
C.
D.
Heap Sort
Insertion Sort
Merge Sort
Bubble Sort
30.
31.
32.
Run Time
Compile Time
Link Time
Load Time
int86
int86X
intdos
All of the above
33.
34.
Compilation Error
10
Segmentation fault
0
Near
Huge
Far
Both B and C
36.
main()
{
Char *p=Hello;
printf(%s,p);
}
Considering the TurboC++ compiler, where will the string Hello be stored in the
Data Segment?
A.
B.
C.
D.
Uninitialized section
Stack
Initialized Section
Both B and C
37. Specify the exact output of the following programs considering TurboC++
compiler
main()
{
int a=10,b=20;
int c[2];
c[0]=100; c[1]=200; c[2]=300;c[3]=400;
printf("%d %d",a,b);
}
A.
B.
C.
D.
10,20
400,300
300,400
300,20
38.
41.
42.
43.
Structure
Union
Both A and B
None of the above
44.
45.
What is the address at which the ISR of keyboard is stored (Consider Turbo
C++ )
A.
B.
C.
D.
46.
47.
32
36
35
39
30
Garbage value
Compilation Error
None of the above
48.
49.
50.
struct REGS
union REGS
struct SREGS
union SREGS