Placement Papers: GloabalEdge Sample Paper

Download PDF of This Page (Size: 137K)

Examrace Placement Series prepares you for the toughest placement exams to top companies.

  1. main () { int i; i = (2, 3); printf ( “%d” i); }

    1. 2

    2. 3

    3. Compiler error

    4. Syntax error.

    ans: 3

  2. main () { char str[] = “GESL” printf ( “%d %d” sizeof (str), strlen (str) ); }

    1. 5, 5

    2. 4, 4

    3. 5, 4

    4. 4, 5

    ans: 5, 4

  3. main () { for (i = 0; i + +; i<100) printf ( “hello world\n” ); }

    1. 100 times

    2. 0 times

    3. Infinite loop

    4. None of the above:

    ans: 0 times.

  4. main () { for (i = 1; i + +; i<100) printf ( “hello world\n” ); }

    1. 100 times

    2. 0 times

    3. Infinite loop

    4. None of the above:

    ans: Infinite loop

  5. main () { char c; scanf ( “%s” c); }

    1. Compiler dependent

    2. unpredictable

    3. Compiler error

    4. scans the i/p.

    ans: Compiler dependent.

  6. main () { int k = 5; for ( + + k<5 && k + +/5 | + + k<8); printf ( “%d\n” k); }

    1. 5

    2. 6

    3. 7

    4. 8

    ans: 7

  7. main () { int * ptr1, * ptr2; ptr1 = (int * ) malloc (sizeof (int) ); ptr2 = func (20, 10, ptr1); printf ( “%d %d\n” * ptr1, * ptr2); } int * func (int a, int b, int * c) { int x = a + b; * c = a-b; return (&x); }

    1. Bug in the code.

    2. No Bugs prints correctly

    3. Error

    4. None of the above:

    Ans: Bug in the code.

  8. int main () { int i = 10, j; if ( (j = ~i) < i) printf ( “True” ); else printf ( “False” ); }

    1. True

    2. False

    3. Compiler Dependent

    4. None of the above:

    ans: True

  9. How many bytes are required to create a 3 * 3 matrix using double pointer ans: 12

  10. take int = 4, float = 8, char = 1 main () { FILE * fp; printf ( “%d\n” sizeof (fp) ); }

    1. 2

    2. 4

    3. Compiler dependent

    4. Error

    Ans: 4

  11. main () { int a = 10, 20; a^ = b^ = a^ = b}; printf ( “%d\n %d\n” a, b)

    1. a = 20, b = 10

    2. a = 10, b = 20

    3. Syntax error

    4. Unpredictable

    Ans: a = 20 b = 10

  12. main () { int i = 10; switch (i) { case 10: Printf ( “Hello” ); { case 1: Printf ( “World” ); } case 5: Printf ( “Hello World” ); } }

    1. Hello

    2. Hello

    3. Hello World Hello World

    4. Syntax Error.

    Ans: Hello World Hello World

  13. main () { char str1[] = “Hello” char str2[] = “Hello” if (str1 = = str2) printf ( “True\n” ); else printf ( “False\n” ); } Ans: False.

    1. True

    2. False

    3. Error

    4. Unpredictable.

  14. main () { # include <stdio. h> int i = 10; printf ( “%d\n” i/2); }

    1. 10

    2. 5

    3. error

    4. warning.

    ans: 5

  15. #include <stdio. h> # pragma pack (2) struct SIZE { int i; char ch; double db; }; main () { printf ( “%d\n” sizeof (struct SIZE) ); }

    1. 12

    2. 14

    3. 16

    4. 8