Placement Papers: GlobalEdge Sample Paper

Get unlimited access to the best preparation resource for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

  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.
  2. Ans: c
  3. 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.
  4. Ans: b
  5. 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
  6. Ans: c
  7. What is the output generated? main () {char ⚹ s = “Hello” printf ( “% s” 1 (s) ) ;}
    1. Hello
    2. ello
    3. e
    4. none of these.
  8. Ans: b
  9. 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