GEOMETRICS Placement Papers 2

by mod on December 31, 2009

1. What is the mistake in the following program segment ?

f()
{
int a;
void c;
f2(&c,&a);}

2. a=0;
b=(a=0)?2:3;

a) What will be the value of b and why ?
b) If in first statement a=0 is replaced by a = -1, b= ?
c) If in second statement a=0 is replaced by a = -1, b=?

3. char *a[2];
int const *p;
int *const p;
struct new { int a;int b; *var[5] (struct new)}

Describe the statements in the above given construct ?

4. f()
{
int a=2;
f1(a++);
}
f1(int c)
{
printf(“%d”, c);
}

What is the value of c ?

5. f1()
{
f(3);
}
f(int t)
{
switch(t);
{
case 2: c=3;
case 3: c=4;
case 4: c=5;
case 5: c=6;
default: c=0;
}

What is the value of c?

6. What is the fallacy in the following program segment ?

int *f1()
{
int a=5;
return &a;
}
f()
int *b=f1()
int c=*b;
}

7. Give the C language equivalents of the following
a)Function returning an int pointer
b)Function pointer returning an int pointer
c)Function pointer returning an array of integers
d)Array of function pointer returning an array of integers

8. Find the fallacy in the following program segment?

int a;
short b;
b=a;

9. Define function ? Explain arguments in functions ?

10. How does C pass variables to a function ?

11. Explain the following program segment.
f(){
int *b;
*b=2;
}

12. Explain binary trees and their use ?

13. Draw the diagram showing the function stack, illustrating the variables that were pushed on the stack at the point when function f2 has been introduced .

type def struct
{ double x,double y} point; }
main( int argc, char *arg[3])
{ double a;
int b,c;
f1(a,b); }

f1(double x, int y)
{point p;
stack int n;
f2(p,x,y)
}

f2(point p, double angle)
{ int i,j,k,int max;

Related posts:

  1. GEOMETRICS Placement Papers 1
  2. GEOMETRICS Pattern
  3. GEOMETRICS Company Profile
  4. GSSL Placement Papers
  5. HCL Placement Paper 1

Leave a Comment

Security Code:

Previous post:

Next post: