Company: HCL Technologies

Test Date : 8 September 2005
Paper Type : Technical – C & C++

Texas Instruments Date : 8/9/2005

given an expression tree and asked us to write the in fix of that expression
four choices : 2

global variables in different files are
a:at compiletime
b) loading time
c) linking time
d)execution time

size of(int)
a) always 2 bytes
b) depends on compiler that is being used
c) always 32 bits
d) can’t tell

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;i1) return(x*factorial(x-1);
}
a) program 1;
b) program 2;
c) both 1 &2
d) none
}

variables of fuction call are allocated in
a) registers and stack
b) registers and heap
c) stack and heap
d)

avg and worst case time of sorted binary tree

data structure used for proority queue
a) linked list b) double linkedd list c)array d) tree

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 print nothing

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)

for hashing which is best on terms of buckets
a)100 b)50 c)21 d)32 ans 32

void f(int value){
for (i=0;i>1) printf(“1”)
else printf(“0”);
}
}
what is printed?
a) bineray value of argument b)bcd value c) hex value d) octal value

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

struck a{
int x;
float y;
char c[10];
}
union b{
int x;
float y;
char c[10];
}
which is true?
a) size of(a)!=sizeof(b);
b)
c)
d)

# 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)

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

main()
{
char a[10]=”hello”;
strcpy(a,’