Creativo - the topper's choice

www.creativo.co.in ( Placement papers of all companies are here )

Monday, May 01, 2006

Subex

1) main(){ int x; printf("\n%d",x=0,x=20,x=40);}ans: 0
2) question om Macro sunstitution ( very easy)
3)main(){ int a[]={1,2,5,6,9,10}; int *b=&a[4]; printf("\n%d",b[-3]);}ans:6
4)main(){ int x=0,y=1; if(x=y) y= 7;elsey=2;value of y?}ans:7
5)question on switch.... case A:case B... some code.
ans:runtime error
6)main(){ int n=39,count=0; while( i & 1) //some condition like this { count++; i>>1; }}value of count?ans:4
7)main(){ int x=128; printf("\n%d",1+x++);}ans:129
8)printf(const char,...);main(){ some code}ans:complier error
9)main(){
FILE *f1; FILE *f2; f1=fopen("myfile","w"); f2=fopen("myfile","w"); fputc('A',f1); fputc('B',f2); fclose(f1); fclose(f2);}what does f1 n f2 conatins?ans:check out this
10)if i/p is code friday monday sunday in commad line thenmain(int argc,char *argv[]){ printf("\n%c",**++argv);}ans:may be f (check out not sure...)
11)#define max 10main(){ printf("\n%d",max++);}ans:compiler error
12)main(){ int a[]={1,2,9,8,6,3,5,7,8,9}; int *p=a+1; int *q=a+6; printf("\n%d",q-p);}ans:5
13)main(){ int i=3; while(i--){ int i=100; i--; printf("\n%d",i); }
}o/p?ans: 99,99,99(this is not infinite loop)
14)what does (*a)[10] means?ans: a is pointer to an array of 10 inegers
15)a big program involving malloc, strlen, strcmp...ans:runtime error

1.#include int main(){char *str = "Hello, world" ;printf("%5s" , str);}Output :
2.int *ptr[10];what is the above?a) declaration of 10 pointersb) declaration and defn of 10 pointersc) declaration and defn of an array of 10 pointersd) none
3.#include int main(){extern int i;printf("%d" , i);}a) garbageb) 0c) compiler errord) linker error
4.#include void temp();void temp(void);int main(){temp();}void temp(){printf("C is exciting!");}Output :
5. #include void temp(int i){if(i == 10) return;i++ ; temp(i);printf("%d" , i);}int main(){temp(1);}Output :
6.int func (int (*)(int) , int);int cube(int n){return (n*n*n);}int main(){prinf("%d" , func(cube , 4));}int func(int (*tmp)(int in) , int n){int res , i;for(i = 1 ; i <= n ; i++) res += *(tmp)(i);return res;}Output :
7.Some question on "strtok" function
8.#include int main(){char *str = "Hello, world";int i = sizeof(str);for( ; i >= 0 ; i--) printf("%c" , str[i]);}
9.Some question on recursion
10.#define MAX(A , B) ( A <>int main(){int a = MAX( 4+2 , 3*2) ; printf(" %d " , a);}
11.Question involving sizes of structure and unions
Part 2 :1) program that recognizes date of any formateven formats like "feb-2-2003" , "02-february-2003" , mm/dd/yy , dd/mm/yy, etc and display it as mm/dd/yy
2) a text filename is given as a command line argument followed by a character as thenext argument. store all sentences NOT beginning with that character(ignore case)in a seperate file.NOTE THAT ITS SETENCES YOU'VE TO CONSIDER AND NOT LINES!!!!
INTERVIEWthere will be 3 rounds interviews,2 tech and 1 hr
1st round1) full c and c++;2)something about project.(6 sem dbms and main);3)prog on linked list (reverse of singly link list) ie. u have contents like (eg:xebus) in l list how will u print it as subexans(using stack or recursion);4)printf and scanf return values 5)v.functs6)const funct(why)7)why static is defined outside the class
2nd round1)single link list prog (using c++ insert front inser rear ins at position delete at position)base class contains 2 functsderived class 2 functions3)osi model;,tcp/ip model4)vertual memory concepts;5)buble sort ,insert sort(with time complexity);6)ipc s in unix;
3rd roundIt is taken by COO of Subex and will be Tech cum HR.They also try to give u some stress so be prepared.

0 Comments:

Post a Comment

<< Home