Placement Papers: GlobalEdge Sample Paper

Download PDF of This Page (Size: 106K)

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

  1. What is the output of the following code? int main () { for (; ); printf ( “Hello\n” ); return 0; }

    1. give compilation error

    2. prints Hello infinite times

    3. Runs in an infinite loop without printing anything.

    4. prints Hello once.

    Ans: c

  2. Output of the code? FUNC (int * p) { p = (int * ) malloc (100); printf ( “p: %x” p); } int main () { int * ptr; FUNC (ptr); printf ( “Ptr: %x” ptr); return 0; }

    1. Both printf statements prints same values.

    2. Both print different values.

    3. Gives compile time error.

    4. Gives run time error.

    Ans: b

  3. Output of the code? int main () { char a[] = “world” printf ( “%d %d\n” strlen (a), sizeof (a) ); return 0; }

    1. 5, 5

    2. 6, 5

    3. 5, 6

    4. 6, 6

    Ans: c

  4. What is the output generated? main () { char * s = “Hello” printf ( “%s” 1 (s) ); }

    1. Hello

    2. ello

    3. e

    4. none of these.

    Ans: b

  5. Interpret the given declaration char ( * (f () ) [ ]) ()

    1. f is a pointer to function returning char

    2. f is a pointer to an array of function returning a char

    3. Invalid declaration

    4. f is a function returning pointer to array[] of pointer to function returning char.

Ans: d