Company: i2 Technologies

i2 Technologies Sample Test Paper

Q1.Convert 0.9375 to binary
    a) 0.0111 
    b) 0.1011 
    c) 0.1111 
    d) none
Ans. ©
 
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
           foo()
           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*);
        main()
            {
                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]Part Two

One Big Question ( 20 Marks , 20 MIN.)

Q. Write a program in C++ (or in C) for the following Data. 
A school Trust That manages many schools in a city has decided to merge two of its branches by moving all the students of different standards and divisions from both the branches to their newly acquired complex. How ever, when moving it is ensured that every student’s standard and division remains same.
Thus a student of 7F (standard 7,division F) from one of the branches will continue to be in 7F in the new school complex.
Given that the student strength of both the branches in the form of a list of division and strength pairs terminated by a $ sign as shown in the example as follows…..
    1A 30     1B 28     2A 35    2B 38     2C 36     2D 34      3A 32     3B 34  …. $
    1A 25     1B 24     1C 26    1D 25     1E 22     2A 40     2B 42       3A 35  ….  $
Write a program to read the above data and output the student strength of the new larger school in the same format.
Your Program
1) Must not assume any limit on the no. of divisions or classes in schools.
2) Must not output divisions with 0 strength.
3) Must use dyna