Friday, September 11, 2009

Interview c coding question


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); }}(a)0,5,9,13,17b) 5,9,13,17c) 12,17,22d) 16,21e) Syntax errorAns. (d)(2) What is the output in the following programmain(){char c=-64;int i=-32unsigned int u =-16;if(c>i){printf("pass1,

No comments:

Post a Comment