Friday 4 January 2008

IBM placement question with solution on c

(1) Output of the following program isvoid 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);

}

}0,5,9,13,17

b) 5,9,13,17

c) 12,17,22

d) 16,21

e) Syntax errorAns. (d)(2) What is the output in the following programmain()

{char c=-64;

No comments:

Post a Comment