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: We now know that the oceans are very deep.
P : For example, the Indian ocean has a range called the Indian Ridge.
Q : Much of it is fairly flat.
R : However, there are great mountain ranges as well.
S : On average the bottom is 2.5 miles to 3.5 miles down
S6: This reaches from the India to the Antarctic.
The Proper sequence should be:

A SQPR

B RSQP

C QPRS

D PQSR

Q2: What will be the output of the program?
#include<stdio.h>
#include<stdlib.h>

int main()
{
    int i=0;
    i++;
    if(i<=5)
    {
        printf("AptitudeCrack");
        exit(1);
        main();
    }
    return 0;
}

A Prints "AptitudeCrack" 5 times

B Prints "AptitudeCrack"

C Infinite loop

D Function main() doesn't calls itself

Q3: What will be the output of the program?
int I = 0;
    outer:
    while (true) 
    {
        I++;
        inner:
        for (int j = 0; j < 10; j++) 
        {
            I += j;
            if (j == 3)
                continue inner;
            break outer;
        }
        continue outer;
    }
System.out.println(I);

A 2

B 1

C 3

D 4

Q4: What will be the output of the program?
for (int i = 0; i < 4; i += 2) 
{ 
    System.out.print(i + ' '); 
} 
System.out.println(i); /* Line 5 */

A 0 1 2 3 4

B 0 2 4

C Compilation fails.

D 0 2 4 5

Q5: What will be the output of the program?
int x = 3; 
int y = 1; 
if (x = y) /* Line 3 */
{
    System.out.println('x =' + x); 
}

A The code runs with no output.

B x = 3

C x = 1

D Compilation fails.

Q6: What will be the output of the program?
Float f = new Float('12'); 
switch (f) 
{
    case 12: System.out.println('Twelve'); 
    case 0: System.out.println('Zero'); 
    default: System.out.println('Default'); 
}

A Default

B Compilation fails

C Twelve

D Zero

Q7: What will be the output of the program?
int i = 0; 
while(1) 
{
    if(i == 4) 
    {
        break;
    } 
    ++i; 
} 
System.out.println('i = ' + i);

A Compilation fails.

B i = 4

C i = 3

D i = 0

Q8: What will be the output of the program?
public class Delta 
{ 
    static boolean foo(char c) 
    {
        System.out.print(c); 
        return true; 
    } 
    public static void main( String[] argv ) 
    {
        int i = 0; 
        for (foo('A'); foo('B') && (i < 2); foo('C')) 
        {
            i++; 
            foo('D'); 
        } 
    } 
}

A Compilation fails.

B ABDCBDCB

C ABCDABCD

D An exception is thrown at runtime.

Q9: What will be the output of the program?
for(int i = 0; i < 3; i++) 
{ 
    switch(i) 
    { 
        case 0: break; 
        case 1: System.out.print('one '); 
        case 2: System.out.print('two '); 
        case 3: System.out.print('three '); 
    } 
} 
System.out.println('done');

A one two three done

B one two done

C done

D one two three two three done

Q10:
What will be the output of the program?
public class Test 
{  
    public static void main(String args[]) 
    { 
        int i = 1, j = 0; 
        switch(i) 
        { 
            case 2: j += 6; 
            case 4: j += 1; 
            default: j += 2; 
            case 0: j += 4; 
        } 
        System.out.println("j = " + j); 
    } 
}

A j = 0

B j = 6

C j = 4

D j = 2