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

TECHNICAL QUESTION FOR IBM PART 4

( if u haven`t read )here is>>> PART 1
>>> PART 2
>>> PART 3


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,");

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