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 RSQP

B QPRS

C PQSR

D SQPR

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 Infinite loop

B Prints "AptitudeCrack"

C Function main() doesn't calls itself

D Prints "AptitudeCrack" 5 times

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 3

B 4

C 2

D 1

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 2 4 5

B 0 1 2 3 4

C Compilation fails.

D 0 2 4

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 = 1

C Compilation fails.

D x = 3

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 Twelve

B Default

C Zero

D Compilation fails

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 i = 4

B Compilation fails.

C i = 0

D i = 3

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 An exception is thrown at runtime.

B Compilation fails.

C ABCDABCD

D ABDCBDCB

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 two three done

B one two done

C one two three done

D 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 = 4

B j = 6

C j = 2

D j = 0