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.
- What is the output of the following code? int main () {for (;) ; printf ( “Hello⧵n” ) ; return 0;}
- give compilation error
- prints Hello infinite times
- Runs in an infinite loop without printing anything.
- prints Hello once.
- Ans: c
- 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;}
- Both printf statements prints same values.
- Both print different values.
- Gives compile time error.
- Gives run time error.
- Ans: b
- Output of the code? int main () {char a [] = “world” printf ( “% d % d⧵n” strlen (a) , sizeof (a) ) ; return 0;}
- 5,5
- 6,5
- 5,6
- 6,6
- Ans: c
- What is the output generated? main () {char ⚹ s = “Hello” printf ( “% s” 1 (s) ) ;}
- Hello
- ello
- e
- none of these.
- Ans: b
- Interpret the given declaration char (⚹ (f () ) [] ) ()
- f is a pointer to function returning char
- f is a pointer to an array of function returning a char
- Invalid declaration
- f is a function returning pointer to array [] of pointer to function returning char.
Ans: d