Creativo - the topper's choice

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

Sunday, April 30, 2006

Mistral

C Section
--------------------------------------------------------------------------------
Mistral Solutions Mistral -1 (Aptitude Test) Mistral -2 (C Test) 1. What does the following program print? #include int sum,count; void main(void) {<> for(count=5;sum+=--count;) printf("%d",sum); } a. The pgm goes to an infinite loop b. Prints 4791010974 c. Prints 4791001974 d. Prints 5802112085 e. Not sure
2. What is the output of the following program? #include void main(void) { int i;<> for(i=2;i<=7;i++) printf("%5d",fno()); } fno() { staticintf1=1,f2=1,f3; return(f3=f1+f2,f1=f2,f2=f3); } a. produce syntax errors b. 2 3 5 8 13 21 will be displayed c. 2 2 2 2 2 2 will be displayed d. none of the above e. Not sure
3. What is the output of the following program? #include void main (void) { int x = 0x1234; int y = 0x5678; x = x & 0x5678; y = y 0x1234; x = x^y; printf("%x\t",x); x = x 0x5678; y = y & 0x1234; y = y^x; printf("%x\t",y); } a. bbb3 bbb7 b. bbb7 bbb3 c. 444c 4448 d. 4448 444c e. Not sure
4. What does the following program print? #include void main (void) { int x; x = 0; if (x=0) printf ("Value of x is 0"); else printf ("Value of x is not 0"); } a. print value of x is 0 b. print value of x is not 0 c. does not print anything on the screen d. there is a syntax error in the if statement e. Not sure
5. What is the output of the following program? #include #include int foo(char *); void main (void) { char arr[100] = {"Welcome to Mistral"}; foo (arr); } foo (char *x) { printf ("%d\t",strlen (x)); printf ("%d\t",sizeof(x)); return0; } a. 100 100 b. 18 100 c. 18 18 d. 18 2 e. Not sure
6. What is the output of the following program? #include display() { printf ("\n Hello World"); return 0; } void main (void) { int (* func_ptr) (); func_ptr = display; printf ("\n %u",func_ptr); (* func_ptr) (); } a. it prints the address of the function display and prints Hello World on the screen b. it prints Hello World two times on the screen c. it prints only the address of the fuction display on the screen d. there is an error in the program e. Not sure
7. What is the output of the following program? #include void main (void) { int i = 0; char ch = 'A'; do putchar (ch); while(i++ < 5 ++ch <= 'F'); } a. ABCDEF will be displayed b. AAAAAABCDEF will displayed c. character 'A' will be displayed infinitely d. none e. Not sure
8. What is the output of the following program? #include #define sum (a,b,c) a+b+c #define avg (a,b,c) sum(a,b,c)/3 #define geq (a,b,c) avg(a,b,c) >= 60 #define lee (a,b,c) avg(a,b,c) <= 60 #define des (a,b,c,d) (d==1?geq(a,b,c):lee(a,b,c)) void main (void) { int num = 70; char ch = '0'; float f = 2.0; if des(num,ch,f,0) puts ("lee.."); else puts("geq..."); } a. syntax error b. geq... will be displayed c. lee.. will be displayed d. none e. Not sure
9. Which of the following statement is correct? a. sizeof('*') is equal to sizeof(int) b. sizeof('*') is equal to sizeof(char) c. sizeof('*') is equal to sizeof(double) d. none e. Not sure
10. What does the following program print? #include char *rev(int val); void main(void) { extern char dec[]; printf ("%c", *rev); } char *rev (int val) { char dec[]="abcde"; return dec; } a. prints abcde b. prints the address of the array dec c. prints garbage, address of the local variable should not returned d. print a e. Not sure
11. What does the following program print? void main(void) { int i; static int k; if(k=='0') printf("one"); else if(k== 48) printf("two"); else printf("three"); } a. prints one b. prints two c. prints three d. prints one three e. Not sure
12. What does the following program print? #include void main(void) { enum sub { chemistry, maths, physics }; struct result { char name[30]; enum sub sc; }; struct result my_res; strcpy (my_res.name,"Patrick"); my_res.sc=physics; printf("name: %s\n",my_res.name); printf("pass in subject: %d\n",my_res.sc); } a. name: Patrick b. name: Patrick c. name: Patrick pass in subject: 2 pass in subject:3 pass in subject:0 d. gives compilation errors e. Not sure
13. What does printf("%s",_FILE_); and printf("%d",_LINE_); do? a. the first printf prints the name of the file and the second printf prints the line no: of the second printf in the file b. _FILE_ and _LINE_ are not valid parameters to printf function c. linker errors will be generated d. compiler errors will be generated e. Not sure
14. What is the output of the following program? #include void swap (int x, int y, int t) { t = x; x = y; y = t; printf ("x inside swap: %d\t y inside swap : %d\n",x,y); } void main(void) { int x; int y; int t; x = 99; y = 100; swap (x,y,t); printf ("x inside main:%d\t y inside main: %d",x,y); } a. x inside swap : 100 y inside swap : 99 x inside main : 100 y inside main : 99b. x inside swap : 100 y inside swap : 99 x inside main : 99 y inside main : 100c. x inside swap : 99 y inside swap : 100 x inside main : 99 y inside main : 100d. x inside swap : 99 y inside swap : 100 x inside main : 100 y inside main : 99e. Not sure
15. Consider the following statements: i) " while loop " is top tested loop ii) " for loop " is bottom tested loop iii) " do - while loop" is top tested loop iv) " while loop" and "do - while loop " are top tested loops. Which among the above statements are false? a. i only b. i & ii c. iii & i d. ii, iii & iv e. Not sure
16. Consider the following piece of code: char *p = "MISTRAL"; printf ("%c\t", *(++p)); p -=1; printf ("%c\t", *(p++)); Now, what does the two printf's display? a. M M b. M I c. I M d. M S e. Not sure
17. What does the following program print? #include struct my_struct { int p:1; int q:1; int r:6; int s:2; }; struct my_struct bigstruct; struct my_struct1 { char m:1; }; struct my_struct1 small struct; void main (void) { printf ("%d %d\n",sizeof (bigstruct),sizeof (smallstruct)); } a. 10 1 b. 2 2 c. 2 1 d. 1 1 e. Not sure
18. Consider the following piece of code: FILE *fp; fp = fopen("myfile.dat","r"); Now fp points to a. the first character in the file. b. a structure which contains a char pointer which points to the first character in the file. c. the name of the file. d. none of the above. e. Not sure.
19. What does the following program print? #include #define SQR (x) (x*x) void main(void) { int a,b=3; a = SQR (b+2); } a. 25 b. 11 c. 17 d. 21 e. Not sure.
20. What does the declaration do? int (*mist) (void *, void *); a. declares mist as a function that takes two void * arguments and returns a pointer to an int. b. declares mist as a pointer to a function that has two void * arguments and returns an int. c. declares mist as a function that takes two void * arguments and returns an int. d. there is a syntax error in the declaration. e. Not sure.
21. What does the following program print? #include void main (void) { int mat [5][5],i,j; int *p; p = & mat [0][0]; for (i=0;i<5;i++) j="0;j<5;j++)"> i=4;j=5; printf( "%d", *(p+i+j)); } a. 25 9 b. 25 5 c. 50 9 d. 50 5 e. Not sure
22. What is the output of the following program? #include void main (void) { short x = 0x3333; short y = 0x4321; long z = x; z = z << z =" z" z =" y;" z =" z">> 16; z = z x; printf("%1x\t",z); z = x; y = x && y; z = y; printf("%1x\t",z); } a. 43213333 3333 1 b. 33334321 4321 4321 c. 33334321 3333 1 d. 43213333 4321 4321 e. Not sure
23. What is the output of the following program? #include void main (void) { char *p = "Bangalore"; #if 0 printf ("%s", p); #endif } a. syntax error #if cannot be used inside main function b. prints Bangalore on the screen c. does not print anything on the screen d. program gives an error "undefined symbol if" e. Not sure
24. If x is declared as an integer, y is declared as float, consider the following expression: y = *(float *)&x; Which one of the following statments is true? a. the program containing the expression produces compilation errors; b. the program containing the expression produces runtime errors; c. the program containing the expression compiles and runs without any errors; d. none of the above e. Not sure
25. What is the return type of calloc function? a. int * b. void * c. no return type: return type is void d. int e. Not sure

1. At A&R auto repair shop, 2 mechanics can repair six cars in three hours. By this same reasoning how many mechanics will it take to repair 22 cars in five hours? a. 8 b. 5 c. 7 d. 6 e. not sure
2. A worker of the CIA(cybernetic information association) is translating information in to a code sequence, so that competitors who might steal the information will not be able to make use of it. The worker is currently translating a word that u can find somewhere in this problem into this code. What number completes this word.: 8 22 10 6 22 13 24 ? a. 5 b. 16 c. 22 d. 26 e. not sure
3.I really need to get a new watch. It correctly reads the time as 4:12pm,but three hours later it reads 8pm.two hours after that it reads 10.32pm.what time will it read when it is actually 3.42am? a. 6:46am b. 1:38am c. 8:24am d. 6:26am e. not sure
4.how many cards are there in a full tarot deck? a. 52 b. 78 c. 96 d. 113 e. not sure
5.what is Excalibur? a. King b. Mage c. Mythical city d. sword e. not sure
6.How many days are there in a fortnight? a. 15 b. 14 c. 10 d. 2 e. not sure
7.What was sundial used for? a. regulating temperature b. refracting light c. measuring time d. scrambling radio waves e. not sure
8.who wrote hunchback of Notre dame? a. Hugo b. Pierre c. Walters d. Anderson e. not sure
9.What is Clark Kent also known as?? a. Dr. Death b. Human Torch c. Superman d. Lone Avenger e. not sure
10.A dresser drawer contains 15 garments. If 40% of those are blouses. How many are not blouses? a. 6 b. 8 c. 9 d. 10 e. not sure
11. If the length of each of the sides of 3square garden plots is increased by 50%,by what % is the sum of the areas of the 3plots increased? a. 375% b. 200% c. 150% d. 125% e. not sure
12.Which of the following equations gives the relationship between R and S in table below?
R 1 2 3 4 5 6 S 2 5 8 11 14 17
a. S=2R b. S=R^2+1 c. S=R^2-1 d. S=3R-1 e. not sure
13. If the length of a rectangle is increased by 20% and the width of the same rectangle is decreased by 20% then the area of the rectangle? a. decr.by 20% b. decr.by 4% c. unchanged d. incr.by 20% e. not sure
14. If n and p r both odd numbers, which of the following numbers must be an even number?? a. n+p b. np c. np+2 d. n+p+1 e. not sure
15. If 2 places r one inch apart on a map, then they r actually 160miles apart. (the scale on the map is 1inch=160miles)if Seton is 2 7/8 inches from Monroe on the map, how many miles is it from Seton to Monroe? a. 460 b. 300 c. 27 d. 360 e. not sure
16. A screw driver and a hammer currently have the same price. If the price of the screw driver rises by 5% and the price of hammer goes up by 3%, by what percent will the cost of 3 screwdrivers and 3 hammers price? a. 3% b. 4% c. 8% d. 25% e. not sure
17. If the average (or arithmetic mean) of six numbers is 4.5, what is the sum of the numbers? a. 4.5 b. 24 c. 27 d. 30 e. not sure
Read the following and answer the questions below:
The office staff of XYZ corporation presently consists of 3 bookkeepers (A, B, C) and 5 Secretaries (D, E, F, G, H). Management is planning to open a new office in another city using 3 secretaries and 2 book keepers of the present staffs. To do so they plan to separate certain individuals who do not function well together. The following guidelines were established to set up the new office. A) Book keepers A & C are constantly finding fault with one another and should not be send as a team to the new office B) C & E function well alone but not as a team . They should be separated. C) D & G have not been on speaking term for many months. They should not go together. D) Since D & F have been competing for promotion, they should not be a team.
18. If A is to be moved as one of the book keepers, which of the following cannot be the possible working unit a. ABDEH b. ABDGH c. ABEFH d. ABEGH e. not sure
19. If C &F are moved to the new office, how many combinations are possible. a. 1 b. 2 c. 3 d. 4 e. not sure
20. If C is send to the new office which member of the staff cannot go with C a. B b. D c. F d. G e. not sure
21. Under the guidelines developed, which of the following must go to the new office. a. B b. D c. E d. G e. not sure
22. If D goes to the new office which of the following is (are ) true? i. C cannot go ii. A cannot go iii. H must also go a. i only b. ii only c. i&iii only d. i, ii, iii e. not sure
23. At luncheon table were 12 men are seated, one-half of the men belongs to club A, one-third belongs to club B and one-fourth belongs to both club. How many belongs to neither. a. 3 b. 4 c. 5 d. 6 e. not sure
For each analogy, find the answer that best completes the problem:
24. Thieves: Den :: Cards: ? a. Game b. Deck c. Set d. Group e. not sure
25. Body: Helmet :: Finger: ? a. Thimble b. Nail c. Glove d. Bandage e. not sure


1. What does the following program print? #include int sum,count; void main(void) {<> for(count=5;sum+=--count;) printf("%d",sum); } a. The pgm goes to an infinite loop b. Prints 4791010974 c. Prints 4791001974 d. Prints 5802112085 e. Not sure
2. What is the output of the following program? #include void main(void) { int i;<> for(i=2;i<=7;i++) printf("%5d",fno()); } fno() { staticintf1=1,f2=1,f3; return(f3=f1+f2,f1=f2,f2=f3); } a. produce syntax errors b. 2 3 5 8 13 21 will be displayed c. 2 2 2 2 2 2 will be displayed d. none of the above e. Not sure
3. What is the output of the following program? #include void main (void) { int x = 0x1234; int y = 0x5678; x = x & 0x5678; y = y 0x1234; x = x^y; printf("%x\t",x); x = x 0x5678; y = y & 0x1234; y = y^x; printf("%x\t",y); } a. bbb3 bbb7 b. bbb7 bbb3 c. 444c 4448 d. 4448 444c e. Not sure
4. What does the following program print? #include void main (void) { int x; x = 0; if (x=0) printf ("Value of x is 0"); else printf ("Value of x is not 0"); } a. print value of x is 0 b. print value of x is not 0 c. does not print anything on the screen d. there is a syntax error in the if statement e. Not sure
5. What is the output of the following program? #include #include int foo(char *); void main (void) { char arr[100] = {"Welcome to Mistral"}; foo (arr); } foo (char *x) { printf ("%d\t",strlen (x)); printf ("%d\t",sizeof(x)); return0; } a. 100 100 b. 18 100 c. 18 18 d. 18 2 e. Not sure
6. What is the output of the following program? #include display() { printf ("\n Hello World"); return 0; } void main (void) { int (* func_ptr) (); func_ptr = display; printf ("\n %u",func_ptr); (* func_ptr) (); } a. it prints the address of the function display and prints Hello World on the screen b. it prints Hello World two times on the screen c. it prints only the address of the fuction display on the screen d. there is an error in the program e. Not sure
7. What is the output of the following program? #include void main (void) { int i = 0; char ch = 'A'; do putchar (ch); while(i++ < 5 ++ch <= 'F'); } a. ABCDEF will be displayed b. AAAAAABCDEF will displayed c. character 'A' will be displayed infinitely d. none e. Not sure
8. What is the output of the following program? #include #define sum (a,b,c) a+b+c #define avg (a,b,c) sum(a,b,c)/3 #define geq (a,b,c) avg(a,b,c) >= 60 #define lee (a,b,c) avg(a,b,c) <= 60 #define des (a,b,c,d) (d==1?geq(a,b,c):lee(a,b,c)) void main (void) { int num = 70; char ch = '0'; float f = 2.0; if des(num,ch,f,0) puts ("lee.."); else puts("geq..."); } a. syntax error b. geq... will be displayed c. lee.. will be displayed d. none e. Not sure
9. Which of the following statement is correct? a. sizeof('*') is equal to sizeof(int) b. sizeof('*') is equal to sizeof(char) c. sizeof('*') is equal to sizeof(double) d. none e. Not sure
10. What does the following program print? #include char *rev(int val); void main(void) { extern char dec[]; printf ("%c", *rev); } char *rev (int val) { char dec[]="abcde"; return dec; } a. prints abcde b. prints the address of the array dec c. prints garbage, address of the local variable should not returned d. print a e. Not sure
11. What does the following program print? void main(void) { int i; static int k; if(k=='0') printf("one"); else if(k== 48) printf("two"); else printf("three"); } a. prints one b. prints two c. prints three d. prints one three e. Not sure
12. What does the following program print? #include void main(void) { enum sub { chemistry, maths, physics }; struct result { char name[30]; enum sub sc; }; struct result my_res; strcpy (my_res.name,"Patrick"); my_res.sc=physics; printf("name: %s\n",my_res.name); printf("pass in subject: %d\n",my_res.sc); } a. name: Patrick b. name: Patrick c. name: Patrick pass in subject: 2 pass in subject:3 pass in subject:0 d. gives compilation errors e. Not sure
13. What does printf("%s",_FILE_); and printf("%d",_LINE_); do? a. the first printf prints the name of the file and the second printf prints the line no: of the second printf in the file b. _FILE_ and _LINE_ are not valid parameters to printf function c. linker errors will be generated d. compiler errors will be generated e. Not sure
14. What is the output of the following program? #include void swap (int x, int y, int t) { t = x; x = y; y = t; printf ("x inside swap: %d\t y inside swap : %d\n",x,y); } void main(void) { int x; int y; int t; x = 99; y = 100; swap (x,y,t); printf ("x inside main:%d\t y inside main: %d",x,y); } a. x inside swap : 100 y inside swap : 99 x inside main : 100 y inside main : 99b. x inside swap : 100 y inside swap : 99 x inside main : 99 y inside main : 100c. x inside swap : 99 y inside swap : 100 x inside main : 99 y inside main : 100d. x inside swap : 99 y inside swap : 100 x inside main : 100 y inside main : 99e. Not sure
15. Consider the following statements: i) " while loop " is top tested loop ii) " for loop " is bottom tested loop iii) " do - while loop" is top tested loop iv) " while loop" and "do - while loop " are top tested loops. Which among the above statements are false? a. i only b. i & ii c. iii & i d. ii, iii & iv e. Not sure
16. Consider the following piece of code: char *p = "MISTRAL"; printf ("%c\t", *(++p)); p -=1; printf ("%c\t", *(p++)); Now, what does the two printf's display? a. M M b. M I c. I M d. M S e. Not sure
17. What does the following program print? #include struct my_struct { int p:1; int q:1; int r:6; int s:2; }; struct my_struct bigstruct; struct my_struct1 { char m:1; }; struct my_struct1 small struct; void main (void) { printf ("%d %d\n",sizeof (bigstruct),sizeof (smallstruct)); } a. 10 1 b. 2 2 c. 2 1 d. 1 1 e. Not sure
18. Consider the following piece of code: FILE *fp; fp = fopen("myfile.dat","r"); Now fp points to a. the first character in the file. b. a structure which contains a char pointer which points to the first character in the file. c. the name of the file. d. none of the above. e. Not sure.
19. What does the following program print? #include #define SQR (x) (x*x) void main(void) { int a,b=3; a = SQR (b+2); } a. 25 b. 11 c. 17 d. 21 e. Not sure.
20. What does the declaration do? int (*mist) (void *, void *); a. declares mist as a function that takes two void * arguments and returns a pointer to an int. b. declares mist as a pointer to a function that has two void * arguments and returns an int. c. declares mist as a function that takes two void * arguments and returns an int. d. there is a syntax error in the declaration. e. Not sure.
21. What does the following program print? #include void main (void) { int mat [5][5],i,j; int *p; p = & mat [0][0]; for (i=0;i<5;i++) j="0;j<5;j++)"> i=4;j=5; printf( "%d", *(p+i+j)); } a. 25 9 b. 25 5 c. 50 9 d. 50 5 e. Not sure
22. What is the output of the following program? #include void main (void) { short x = 0x3333; short y = 0x4321; long z = x; z = z << z =" z" z =" y;" z =" z">> 16; z = z x; printf("%1x\t",z); z = x; y = x && y; z = y; printf("%1x\t",z); } a. 43213333 3333 1 b. 33334321 4321 4321 c. 33334321 3333 1 d. 43213333 4321 4321 e. Not sure
23. What is the output of the following program? #include void main (void) { char *p = "Bangalore"; #if 0 printf ("%s", p); #endif } a. syntax error #if cannot be used inside main function b. prints Bangalore on the screen c. does not print anything on the screen d. program gives an error "undefined symbol if" e. Not sure
24. If x is declared as an integer, y is declared as float, consider the following expression: y = *(float *)&x; Which one of the following statments is true? a. the program containing the expression produces compilation errors; b. the program containing the expression produces runtime errors; c. the program containing the expression compiles and runs without any errors; d. none of the above e. Not sure
25. What is the return type of calloc function? a. int * b. void * c. no return type: return type is void d. int e. Not sure

0 Comments:

Post a Comment

<< Home