image not found

Oops! That page can't be found.


Directions to Solve

In questions below, each passage consist of six sentences. The first and sixth sentence are given in the begining. The middle four sentences in each have been removed and jumbled up. These are labelled as P, Q, R and S. Find out the proper order for the four sentences.

Q1:
S1: A black haired, young woman came tripping along.
P : She was leading a young woman wearing a hat.
Q : The woman swept it off and tossed it in the air.
R : The child jumped up to catch the hat.
S : The young man tossed his head to shake the hat back.
S6: Both disappeared from view.
The Proper sequence should be:

A PSQR

B RPSQ

C QRPS

D SQRP

Q2: What will be the output of the program?
#include<stdio.h>
int fun(int);
int main()
{
    float k=3;
    fun(k=fun(fun(k)));
    printf("%f\n", k);
    return 0;
}
int fun(int i)
{
    i++;
    return i;
}

A 5.000000

B 3.000000

C Garbage value

D 4.000000

Q3: What will be the output of the program?
int i = 1, j = 10; 
do 
{
    if(i > j) 
    {
        break; 
    } 
    j--; 
} while (++i < 5); 
System.out.println('i = ' + i + ' and j = ' + j);

A i = 6 and j = 5

B i = 5 and j = 5

C i = 6 and j = 4

D i = 5 and j = 6

Q4: What will be the output of the program?
public class Switch2 
{
    final static short x = 2;
    public static int y = 0;
    public static void main(String [] args) 
    {
        for (int z=0; z < 3; z++) 
        {
            switch (z) 
            {
                case x: System.out.print('0 ');
                case x-1: System.out.print('1 ');
                case x-2: System.out.print('2 ');
            }
        }
    }
}

A 0 1 2

B 0 1 2 1 2 2

C 2 1 0 1 0 0

D 2 1 2 0 1 2

Q5:
What will be the output of the program?
public class SwitchTest 
{  
    public static void main(String[] args) 
    {
        System.out.println('value =' + switchIt(4)); 
    } 
    public static int switchIt(int x) 
    {
        int j = 1;  
        switch (x) 
        { 
            case l: j++; 
            case 2: j++;  
            case 3: j++; 
            case 4: j++; 
            case 5: j++; 
            default: j++; 
            } 
        return j + x;  
    } 
}

A value = 2

B value = 4

C value = 6

D value = 8

Q6:
What will be the output of the program?
public class If2 
{
    static boolean b1, b2;
    public static void main(String [] args) 
    {
        int x = 0;
        if ( !b1 ) /* Line 7 */
        {
            if ( !b2 ) /* Line 9 */
            {
                b1 = true;
                x++;
                if ( 5 > 6 ) 
                {
                    x++;
                }
                if ( !b1 ) 
                    x = x + 10;
                else if ( b2 = true ) /* Line 19 */
                    x = x + 100;
                else if ( b1 | b2 ) /* Line 21 */
                    x = x + 1000;
            }
        }
        System.out.println(x);
    }
}

A 0

B 1

C 101

D 111

Q7: What will be the output of the program?
public class Switch2 
{
    final static short x = 2;
    public static int y = 0;
    public static void main(String [] args) 
    {
        for (int z=0; z < 3; z++) 
        {
            switch (z) 
            {
                case y: System.out.print('0 ');   /* Line 11 */
                case x-1: System.out.print('1 '); /* Line 12 */
                case x: System.out.print('2 ');   /* Line 13 */
            }
        }
    }
}

A 0 1 2

B 0 1 2 1 2 2

C Compilation fails at line 11.

D Compilation fails at line 12.

Q8: What will be the output of the program?
public class If1 
{
    static boolean b;
    public static void main(String [] args) 
    {
        short hand = 42;
        if ( hand < 50 && !b ) /* Line 7 */
            hand++;
        if ( hand > 50 );     /* Line 9 */
        else if ( hand > 40 ) 
        {
            hand += 7;
            hand++;    
        }
        else
            --hand;
        System.out.println(hand);
    }
}

A 41

B 42

C 50

D 51

Q9: What will be the output of the program?
public class Test 
{
    public static void main(String [] args) 
    {
        int I = 1;
        do while ( I < 1 )
        System.out.print('I is ' + I);
        while ( I > 1 ) ;
    }
}

A I is 1

B I is 1 I is 1

C No output is produced.

D Compilation error

Q10: What will be the output of the program?
int x = l, y = 6; 
while (y--) 
{
    x++; 
} 
System.out.println('x = ' + x +' y = ' + y);

A x = 6 y = 0

B x = 7 y = 0

C x = 6 y = -1

D Compilation fails.