Company: i2 Technologies

Q1.Convert 0.9375 to binary
a) 0.0111
b) 0.1011
c) 0.1111
d) none
Ans. (c)

Q2.( 1a00 * 10b )/ 1010 = 100
a) a=0, b=0
b)a=0, b=1
c) none
Ans. (b)

Q3. In 32 bit memory machine 24 bits for mantissa and 8 bits for exponent. To increase the range of floating point.
a) more than 32 bit is to be there.
b) increase 1 bit for mantissa and decrease 1 bit for exponent
c) increase 1 bit for exponent and decrease one bit for mantissa

Q4.In C, “X ? Y : Z ” is equal to
a) if (X==0) Y ;else Z
b) if (X!=0) Y ;else Z
c) if (X==0) Y ; Z
Ans. (b)

Q5. From the following program
int foo(int a, int b)
if (a&b) return 1;
return 0;
a) if either a or b are zero returns always 0
b) if both a & b are non zero returns always 1
c) if both a and b are negative returns 0

Q6. The following function gives some error. What changes have to be made
void ( int a,int b)
int t; t=a; a=b; b=t;
a) define void as int and write return t
b) change everywhere a to *a and b to *b

Q7. Which of the following is incorrect
a) if a and b are defined as int arrays then (a==b) can never be true
b) parameters are passed to functions only by values
c) defining functions in nested loops

Q8. include
void swap(int*,int*);
int arr[8]={36,8,97,0,161,164,3,9}
for (int i=0; i<7; i++) { for (int j=i+1; j<8;j++) if(arr[i]<arr[j]) swap(&arr[i],&arr[j]);=”” }=”” void=”” swap(int*x,int*y)=”” {=”” int=”” temp;=”” static=”” cnt=”0;” temp=”*x;” *x=”*y;” *y=”temp;” cnt++;=”” what=”” is=”” equal=”” to=”” a)=”” 7=”” b)=”” 15=”” c)=”” 1=”” d)=”” none=”” of=”” these=”” q9.=”” main()=”” file=”” *fp;=”” fp=”fopen(“test.dat”,”w”);” fprintf(fp,’hellon”);=”” fclose(fp);=”” (“test.dat”,”w”);=”” fprintf=”” (fp,=”” “world”);=”” return=”” 0;=”” if=”” text.dat=”” already=”” present=”” after=”” compiling=”” and=”” execution=”” how=”” many=”” bytes=”” does=”” the=”” occupy=”” ?=”” 0=”” 5=”” 11=”” data=”” insufficient=”” q10.=”” f1(int*x,intflag)=”” *y;=”” switch(flag)=”” case=”” 0:=”” break;=”” 1:=”” 2:=”” return(*y)=”” i=”f1(x,0);” j=”f1(x,1);” printf(“%d=”” %d=”” “,i,j,*x);=”” output?=”” 8=”” <=”” p=””></arr[j])>

Read More