37)size of(int)
a) always 2 bytes
b) depends on compiler that is being used
c) always 32 bits
d) can't tell
38)which one will over flow given two programs
2
prog 1: prog2:
main() main()
{ {
int fact; int fact=0
long int x; for(i=1;i<=n;i++)
fact=factoral(x); fact=fact*i;
} }int factorial(long int x)
{
if(x>1) return(x*factorial(x-1);
}
a) program 1;
b) program 2;
c) both 1 &2
d) none
}
39) variables of fuction call are allocated in
a) registers and stack
b) registers and heap
c) stack and heap
d)
40)
avg and worst case time of sorted binary tree7) data structure used for
proority queue
a) linked list b) double linkedd list c)array d) tree
41)
main(){
char str[5]="hello";
if(str==NULL) printf("string null");
else printf("string not null");
}
what is out put of the program?
a) string is null b) string is not null c) error in program d) it
executes but p
rint nothing
42)there are 0ne 5 pipe line and another 12 pipe line sates are there
and flushed
time taken to execute five instructions
a) 10,17
b) 9,16
c)25,144
d)10)
for hashing which is best on terms of buckets
a)100 b)50 c)21 d)32 ans 32
43)void f(int value){
for (i=0;i<16;i++){
if(value &0x8000>>1) printf("1")
else printf("0");
}
}
what is printed?
a) bineray value of argument b)bcd value c) hex value d) octal value
44)void f(int *p){
static val=100;
val=&p;
}
main(){
int a=10;
printf("%d ",a);
f(&a);
printf("%d ",a);
}
what will be out put?
a)10,10
45)# define f(a,b) a+b
#defiune g(c,d) c*d
find valueof f(4,g(5,6))
a)26 b)51 c) d)
46)
find avg access time of cache
a)tc*h+(1-h)*tm b)tcH+tmH
c) d) tc is time to access cache tm is time to access when miss occure
47)
main()
{
char a[10]="hello";
strcpy(a,'\0');
printf("%s",a);
}
out put of the program?
a) string is null b) string is not null c) program error d)
48)
simplyfy k map
1 x x 0
1 x 0 1
49) char a[5][15];
int b[5][15];
address of a 0x1000 and b is 0x2000 find address of a[3][4] and b[3][4]
assume char is 8 bits and int is 32 bits
50) main()
{
fork();
fork();
fork();
printf("\n hello");
}
How many times print command is executed?
51)main()
{
int i,*j;
i=5;
j=&i;
printf("\ni= %d",i);
f(j);
printf("\n i= %d",i);
}
void f(int*j)
{
int k=10;
j= &k;
}
output is
a 5 10
b 10 5
c 5 5
d none
3.
some question on pipeline like you have to findout the total time
by which execution is completed for a pipeline of 5 stages.
53)
main()
{
int *s = "\0";
if(strcmp(s,NULL)== 0)
printf("\n s is null")p
else
printf("\n s is not null");
}
54). size of integer is
a. 2 bytes
b 4 bytes
c. machine dependant
d compiler dependent.
55).max and avg. height of sorted binary tree
a. logn n
b n logn
56). int a[5][4]
int is 2 bytes base address for array is 4000(Hexa)
what will be addr for a[3][4]?
int is 4 bytes same question.
57)
implementation of priority queue
a. tree
b linked list
c doubly linked list.
58)which of following operator can't be overloaded.
a)== b)++ c)?! d)<=
59)#include<iostream.h
main()
{
printf("Hello World");
}
the program prints Hello World without changing main() the o/p should
be
intialisation
Hello World
Desruct
the changes should be
a)iostream operator<<(iostream os, char*s)
os<<'intialisation'<<(Hello World)<<Destruct
b) c) d)none of the above
60) term stickily bit is related to
a)kernel
b)undeletable file
c) d)none
61)semaphore variable is different from ordinary variable by
62)swap(int x,y)
{
int temp;
temp=x;
x=y;
y=temp;
}
main()
{
int x=2;y=3;
swap(x,y);
}
after calling swap ,what are yhe values x&y?
63) static variable will be visible in
a)fn. in which they are defined
b)module " " " "
c)all the program
d)none
64)TCP/IP can work on
a)ethernet
b)tokenring
c)a&b
d)none
65)a node has the ip address 138.50.10.7 and 138.50.10.9.But it is
transmitting data from node1 to node2only. The reason may be
a)a node cannot have more than one address
b)class A should have second octet different
c)classB " " " " "
d)a,b,c
66)for an application which exceeds 64k the memory model should be
a)medium
b)huge
c)large
d)none
67)the condition required for dead lock in unix sustem is
68)set-user-id is related to (in unix)
69)wrong statement about c++
a)code removably
b)encapsulation of data and code
c)program easy maintenance
d)program runs faster
70)struct base {int a,b;
base();
int virtual function1();
}
struct derv1:base{
int b,c,d;
derv1()
int virtual function1();
}
struct derv2 : base
{int a,e;
}
base::base()
{
a=2;b=3;
}
derv1::derv1(){
b=5;
c=10;d=11;}
base::function1()
{return(100);
}
derv1::function1()
{
return(200);
}
main()
base ba;
derv1 d1,d2;
printf("%d %d",d1.a,d1.b)
o/p is
a)a=2;b=3;
b)a=3; b=2;
c)a=5; b=10;
d)none
71) for the above program answer the following q's
main()
base da;
derv1 d1;
derv2 d2;
printf("%d %d %d",da.function1(),d1.function1(),d2.function1());
o/p is
a)100,200,200;
b)200,100,200;
c)200,200,100;
d)none
72)struct {
int x;
int y;
}abc;
you can not access x by the following
1)abc-- x;
2)abc[0]-- x;
abc.x;
(abc)-- x;
a)1,2,3
b)2&3
c)1&2
d)1,3,4
73) automatic variables are destroyed after fn. ends because
a)stored in swap
b)stored in stack and poped out after fn. returns
c)stored in data area
d)stored in disk
74) relation between x-application and x-server (x-win)
75)which is right in ms-windows
a)application has single qvalue system has multiple qvalue
b) " multiple " " single "
c)" " " multiple "
d)none
76)widget in x-windows is
77)gadget in x_windows is
78)variable DESTDIR in make program is accessed as
a)$(DESTDIR)
b)${DESTDIR}
c)DESTDIR
d)DESTDIR
79)the keystroke mouse entrie are interpreted in ms windows as
a)interrupt
b)message
c)event
d)none of the above
80)link between program and out side world (ms -win)
a)device driver and hardware disk
b)application and device driver
c)application and hardware device
d)none
81)dynimic scoping is
82)process dies out but still waita
a)exit
b)wakeup
c)zombie
d)steep
83)in dynamic memory allocation we use
a)doubly linked list
b)circularly linked
c)B trees
d)L trees
e)none
84)to find the key of search the data structure is
a)hask key
b)trees
c)linked lists
d)records
85)data base
--------------------------
--------------------------------
employ_code salary employ_code leave
---------------------------
----------------------------------
from to
--------------------------------------
1236 1500 1238 --- ---
1237 2000 1238 --- ---
1238 2500 1237 ---
-----
1237 --- ---
1237 --- ---
1237 --- ---
-------------------------- --------------------------------------
select employ_code,employ_data ,leave
the number of rows in the o/p
a)18
b)6
c)7
d)3
86)which is true
a)bridge connects dissimiler LANand protocol insensitive
b)router " " " " "
c)gateway " " " " "
d)none of the above
87).main(argc,argv)
{
if(argc<1)
printf("error");
else
exit(0);
}
If this program is compiled without giving any argument ,what it will
print.
88).read the folllowing code
# define MAX 100
# define MIN 100
....
....
if(x>MAX)
x=1;
else if(x<MIN)
x=-1;
x=50;
if the initial value of x=200,what is the vlaue after executing this
code?
a.200
b.1
c.-1
d.50
89).a memory of 20 bytes is allocated to a string declared as char *s
then the following two statements are executed:
s="Etrance"
l=strlen(s);
what is the value of l ?
a.20
b.8
c.9
d.21
90).given the piece of code
int a[50];
int *pa;
pa=a;
to access the 6th element of the array which of the following is
incorrect?
a.*(a+5)
b.a[5]
c.pa[5]
d.*(*pa + 5)
91).consider the following structure:
struct num nam{
int no;
char name[25];
};
struct num nam
n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}};
.....
.....
printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1);
What does the above statement print?
a.8,9
b.9,9
c.8,8
d.8,unpredictable value
92).identify the incorrect expression
a. a=b=3=4;
b. a=b=c=d=0;
c. float a=int b=3.5;
d. int a;
float b;
a=b=3.5;
92-c
93).which of the following is invalid
a. a+=b
b. a*=b
c. a>>=b
d. a**=b
93-d
94).what is y value of the code if input x=10
y=5;
if (x==10)
else if(x==9)
else y=8;
a.9
b.8
c.6
d.5
94-d
96).a=0;
while(a<5)
printf("%d\n",a++);
how many times does the loop occurs?
a.infinite
b.5
c.4
d.6
96-b
97)how many times does the loop iterated ?
for (i=0;i=10;i+=2)
printf("Hi\n");
a.10
b.2
c.5
d. infinite
97-d
98)what is incorrect among teh following
A recursive functiion
a.calls itself
b.is equivalent to a loop
c.has a termination cond
d.does not have a return value at all