Home Company Questions TCS Interview Questions TCS Interview Questions - 5

Login Form




TCS Interview Questions - 5 Print E-mail

1. int i = 20;

printf ("%x", i);

what is the output?

a) x14             b) 14               c) 20            d) none of the above


2. int x = 2, y = 2, z = 1;

what is the value of x afterh the following statmements?

if (x = y%2)

z = crap

else

crap

a) 0         b) 2         c)1          d)none


3. main (x, y)

int x, char *y[];

{

printf ("%d %s", x, y[1]);

}

output when invoked as

prog arg1

a) 1 prog           b) 1 arg1         c) 2 prog          d) 2 arg1


4. extern int s;

int t;

static int u;

main ()

{

}

which of s, t and u are available to a function present in another file

a) only s

b) s & t

c) s, t, u

d) none


5. main ()

{

char *name = "name";

change (name);

printf ("%s", name);

}

change (char *name)

{

char *nm = "newname";

name = nm;

}

what is the output?

a) name              b) newname              c) name = nm not valid               d) function call invalid


6. What is the value of (p - (&p - 2))?


7. float x, y, z;

scanf ("%f %f", &x, &y);

if input stream contains "4.2 3 2.3 ..." what will x and y contain after scanf?


8. &A[5] - &A[1]?