Mar 7, 2011

31. Find the missing number in 16, 33, 65, 131, 261, _____


Answer: 523
Explanation:
Each number is twice the preceding one with 1 added or subtracted alternatively.
So, the next number is (2 x 261 + 1) = 523.

Mar 4, 2011

29. P is the mother of K; K is the sister of D; D is the father of J. How is P related to J?

Answer: 
Grand mother
Explanation:
P is the mother of K
K is the sister of D
D is the father of J.
Therefore, J is the nephew or niece of K and P is the grandmother of J.

Mar 2, 2011

28. Find the output


Program:
main()
{
    int a[5] = {5, 1, 15, 20, 25};
    int i, j, m;
    i = ++a[1];
    j = a[1]++;
    m = a[i++];
    printf("%d, %d, %d", i, j, m);
}



Ans : 3,2,15

Explanation :

Step 1int a[5] = {5, 1, 15, 20, 25}; The variable arr is declared as an integer array with a size of 5 and it is initialized to
a[0] = 5a[1] = 1a[2] = 15a[3] = 20a[4] = 25 .
Step 2int i, j, m; The variable i,j,m are declared as an integer type.
Step 3i = ++a[1]; becomes i = ++1; Hence i = 2 and a[1] = 2
Step 4j = a[1]++; becomes j = 2++; Hence j = 2 and a[1] = 3.
Step 5m = a[i++]; becomes m = a[2]; Hence m = 15 and i is incremented by 1(i++ means 2++ so i=3)
Step 6printf("%d, %d, %d", i, j, m); It prints the value of the variables i, j, m
Hence the output of the program is 3, 2, 15

27. In how many ways can the letters of the word 'LEADER' be arranged?

Ans : 360


Explanation :

The word 'LEADER' contains 6 letters, namely 1L, 2E, 1A, 1D and 1R.
 Required number of ways =6!= 360.
(1!)(2!)(1!)(1!)(1!)

Feb 24, 2011

24. Find the output.

void main()
{
int i=3, *j, k;
j = &i;
printf("%d\n", i**j*i+*j);
}


Answer: 
30

Feb 23, 2011

23. A triangle is made from a rope. The sides of the triangle are 25 cm, 11 cm and 31 cm. What will be the area of the square made from the same rope?


Solution: 
Add all sides 25+11+31 to get rope length rope length =67,rope is made in to as square. So side of square is 67/4=16.75 and so area is 16.75*16.75=280.5625.
Ans : 280.5625