MOST ASKED TECHNICAL QUESTIONS FOR IBM (part 2 of 5)

PART 2 TECHNICAL QUESTIONS SET

here`s part 1 if u havent read

Q Which of the following API is used to hide a window

a) ShowWindow

b) EnableWindow

c) MoveWindow

d) SetWindowPlacement

e)None of the above

Ans) a

Q enum number { a=-1, b= 4,c,d,e} what is the value of e ?
a)6
b)7
c)8
d)9
ans b

Q PS1 pwd

export PS1 results in

a). your primary prompt being your current directory

b). " " and secondary prompts being the current dir

c). " " prompt being your home dir

d). " " and secondary prompts being the home dir

e). None of the above.
ans a

Q In the process table entry for the kernel process, the process id value is

a) 0
b) 1
c) 2
d) 255
e) it does not have a process table entry

Ans) a

Q + means * and * means / and / means % what is the value of 2+3*5/7
ans 1.2


18)What will be the result of the following program?

main()

{

char p[]="String";

int x=0;



if(p=="String")

{

printf("Pass 1");

if(p[sizeof(p)-2]=='g')

printf("Pass 2");

else

printf("Fail 2");

}

else

{

printf("Fail 1");

if(p[sizeof(p)-2]=='g')

printf("Pass 2");

else

printf("Fail 2");

}

}



a) Pass 1, Pass 2

b) Fail 1, Fail 2

c) Pass 1, Fail 2

d) Fail 1, Pass 2

e) syntax error during compiation


19)In the following code segment what will be the result of the function,

value of x , value of y



{

unsigned int x=-1;

int y;

y = ~0;

if(x == y)

printf("same");

else

printf("not same");

}



a) same, MAXINT, -1

b) not same, MAXINT, -MAXINT

c) same , MAXUNIT, -1

d) same, MAXUNIT, MAXUNIT

e) not same, MAXINT, MAXUNIT

Ans) a

20)what will the following program do?

void main()

{

int i;

char a[]="String";

char *p="New Sring";

char *Temp;

Temp=a;

a=malloc(strlen(p) + 1);

strcpy(a,p); //Line no:9//

p = malloc(strlen(Temp) + 1);

strcpy(p,Temp);

printf("(%s, %s)",a,p);

free(p);

free(a);

} //Line no 15//



a) Swap contents of p & a and print:(New string, string)

b) Generate compilation error in line number 8

c) Generate compilation error in line number 5

d) Generate compilation error in line number 7

e) Generate compilation error in line number 1

Ans) b

Q What is the result

main()

{

char c=-64;

int i=-32

unsigned int u =-16;

if(c>i){

printf("pass1,");

if(c

printf("pass2");

else

printf("Fail2");}

else

printf("Fail1);

if(i

printf("pass2");

else

printf("Fail2")

}

a)Pass1,Pass2

b)Pass1,Fail2

c)Fail1,Pass2

d)Fail1,Fail2

e)none

(Ans is c)

Q Result of the following program is

main()

{

int i=0;

for(i=0;i<20;i++)

{

switch(i)

case 0:i+=5;

case 1:i+=2;

case 5:i+=5;

default i+=4;

break;}

printf("%d,",i);

}

}

a)0,5,9,13,17

b)5,9,13,17

c)12,17,22

d)16,21

e)syntax error

(Ans is d )

Q what will be the result of the following program ?

char *gxxx()

{

static char xxx[1024];

return xxx;

}



main()

{

char *g="string";

strcpy(gxxx(),g);

g = gxxx();

strcpy(g,"oldstring");

printf("The string is : %s",gxxx());

}

a) The string is : string

b) The string is :Oldstring

c) Run time error/Core dump

d) Syntax error during compilation

e) None of these

Ans) b

Q) Result of the following program is

main()

{

int i=0;

for(i=0;i<20;i++)

{

switch(i)

case 0:i+=5;

case 1:i+=2;

case 5:i+=5;

default i+=4;

break;}

printf("%d,",i);

}

}

a)0,5,9,13,17

b)5,9,13,17

c)12,17,22

d)16,21

e)syntax error

ans e or d

No comments:

Take Advantage Of 25 of the finest Articles to help u prepare for the Placement Papers and Interview questions
You’d Never Guess How easy it is to get a job after reading these placement preparation articles

Here are 25 Placement Preparation Articles


"IMPORTANT NOTE"
We Update our site frequently and we want to keep you guys informed so enter your email in the top left hand box and click subscribe,so that whenever we post new papers it gets delivered right to your mail.



 

© New Placement papers | Latest Placement Papers