Creativo - the topper's choice

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

Saturday, April 29, 2006

Deshaw

D. E. Shaw & Co. DEShaw Test Paper SECTION-A
Write the programs for the following problems in C.
1. Swap two variables x,y without using a temporary variable.
2. Write algorithm for finding the GCD of a number.
3.Write a program for reversing the given string.
4. The integers from 1 to n are stored in an array in a random fashion. but one integer is missing. Write a program to find the missing integer.
Ans). Hint : The sum of n natural numbers is = n(n+1)/2. if we subtract the above sum from the sum of all the numbers in the array , the result is nothing but the missing number.
5. Some bit type of questions has been given on pointers asking to to find whether it is correct from syntax point of view. and if it is correct explain what it will do.(around 15 bits).

SECTION-B
6. For the following C program
#define AND &&#define ARRANGE (a>25 AND a<50)main(){int a =" 30;if" floatr1="6.25,r2="2.5,a;a="AREA(r1);printf(" a="AREA(r2);printf("> temp, $wc -l temp (a) 9 (b) 10 (c) 11 (d) undefined. ans : b 3. If one wants the output of one command( command1) to be printed inthe printer as well as to be added to another file (outfile) which one of the following is a currect command he can give? (a) $command1 >>outfiletee lpr (b) $tee -a command1 lpr (c) $ command1 tee outfile lpr (d) $ command tee -a outfile lpr ans : d (4) In the shell program set -x will cause A. Execution of the commands in the background B. Execution of the commands in verbose mode C. Exit from the shell program. D. Exit from the shell program after executing the next command (5) ACL in UNIX refers to A. Acces Control List B. Action Control List C. Application Command Language D. Advanced C lanuage (6) The command echo* A. will print * on the screen B. will print contents of all the files in the current directory C. will list the files in the current directory D. will print the contents of all shell variables (7) ls date will A. print the name of the files in the current directory B. print today's date and time C. (A) followed by (B) D. none of the above (8) The built-in shell variable $$ refers to A. printing numbers in dollar format B. proces id_ of last command C. proces id_ of last background command issued D. proces-id of current shell (9) dd is mainly used for A. dealing with raw, unformated data, whatever the source B. dealing with data dictionary C. deleting a directory D. none of the above (10) vis in UNIX is A. a command that takes only one input B. a command for deleting strange or unwanted characters that may have crept into files. C. Points non-printable characters in understandable format D. All of the above (11) Which of the following is true regarding the UNIX (i) Multiuser Operating System (ii)Multitasking Operating System (iii) Real timing Operating System A. i only B. i and ii only C. i and ii and iii only D. i and ii (12) ln command is used to A. link object codes into a executable code B. give two names to the same file C. set line numbers for the file D. none of the above (13) nohup command is used for A. Protecting the execution of programmes from aborting when hangup signal is received B. Changing the execution priority of the programs C. Not hanging up of the modem D. Disconnecting a node from the system (14) SCCS is a A. Tool for maintaining large programmes in a production environment B. Communication Protocol C. Shell Programming Language D. String processing utility (15) Which one of the following is true as long as UNIX is concerned A. One can do programming in C only B. It can support terminals capable of printing only uppercase characters C. The text files are sorted as it is in MS-DOS D. None of the above (16) Inside vi editor to replace the string /10/$/94 with 10/$$/92 globally the following command can be used A. :1,$ s/\/10\/\$\/94/10\/\$\$\/92/g B. :1,$ s/\/10\/\$\/94/10\/\$\/$92/ C. :s/10/$/94/10/$$/92/g D. :1,$ s/\/10\/$\/94/10\/$$\/92/g (17) The ed command without any argument A. will print the current working directory B. will make the home directory as current directory C. will ask for the directory to be used as the current directory D. will go to the previous directory (18) nice command is used A. to increase/decrease execution priority of a command B. to compress a file C. to run a programme at latter time D. to set the key board responce slower (19) What will be the output of the following command sequence $ x='I am x' $sh $echo $x A. I am x B. Blank line C. x D. None of the above (20) The command tr a-z 0-9 <>(y)?(x):(y) main() { intx=5,y=5; printf("maximum is %d",MAX(++x,++y)); } the outpput of the programis a)maximum is 7 (b)maximum is 5 (c)maximum is 6 d)none of the above 2)given the following definitions int *p,*q,r; int values[30]; p=&values[0]; q=values+29; r=++q-p; what will be the value of r ? a)address of q minus p b)number of elements in the array c)(value pointed by q)+1-(value pointed by p) d)none of the above 3)what will the output of the program? #include //print the sum of the series 1/5+1/4+.... static int =5; main() { int sum=0; do { sum+=(1/i); }while(0main(){ intoldvar=80;newvar=-80; int swap(int,int); swap(oldvar,newvar); printf("numbers are %d\t%d",newvar ,oldvar); } int swap(intolval,int neval) { int temval=olval; olval=neval; neval=temval; } the output of the program isa)numbers are 80-80b)numbers are 80 80c)numbers are -80 80d)numbers are -80 -80
5 STUDY THE PROGRAM BELOW, WHICH OF THE FOLLOWING STATEMENT WILL MAKEPROGRAM WORK :- main () { int *! = 10 , *j=20; i=i*j; }
A) Replace i = i*j; as i = (int) ((int) i * (int)j);B) No errorC) Replacei= i*j;as i = (int*) ((int)i*(int)j);D) Replace i+i*j ; as i = (int) i* (int)j;
6 Study the following program #includeenum mode = {green,red,orange,blue ,white};main (){ green = green +!; printf("%d,%d",green,red );
}
The output of the program will be :-
A) 1,1 B) 0,1 C) No output, error in compilation d) None of the above
7 Study th following statements.
#define DELAYTIME 1000volatile extern int k;intj;
for (i=0;imain(){char buff[] = "this is a test";int i, *ptr;ptr = (int*)buff;for (i=0;*ptr; i++);printf("%c",*ptr++);}
The following will be the output
A) This is a test B) It'll print junk C) Compilation errorD) None of the above
9 Select the explanation for the following declaration itn (*(*ptr)(int)) (void)A) ptr is apointer pointing to a integer function that takes an intvalues returns an integer which will points to a function with no argument.B) ptr is pointer to function that takes an int value returns a pointer to a function with ano argument which returns a integer c) This is not a valid C statement.D) None of the above. 10 Study the following program
# include char *c[] ={ "FILE", "EDIT", "SEARCH", "COMPILE", }; HAR **cp[] = {c+3,c+2,c+1,c};char ***cpp = cp;main(){ printf("%s", **cpp); printf("%s"< *--*++cpp+3); printf("%s", *cpp[-2]+3); printf("%s\n",cpp[-1][-1]+1); } The output of this program is A) SEARCHFILEEDITCOMPILE B) SEARCHCOMPILEEDITC) SEARCHEPILEDIT D) None of the above 11 What is the size of ptr1 and ptr2. struct x { int j; char k[100]; unsigned i;};int *ptr1:struct X *ptr2; A) Same depending on the model used B) 2,104C) 2, Undefined for memory is not allocated D) 2,4 12 If i = i * 16; Which of the following is a better approach to do the operationA) Multiply i by 16 and keep it B) Shift left by 4 bitsC) Add i 16 times D) None of the above 13 What is the output of the following program #includemain(){int i = 0;switc(i) {case 0 : i++; case 1 : i++2;case2 : ++i;}printf("%d",i++);}
output of the program :-A) 1 B) 3 C) 4 D) 5
14 In the following , where means
lseek(fd,0L,SEEK_END);where = tell(fd);A) End of file. B) Head of file C) Cannot be definedD) In between head and end of file.
15 Assuming that you are using IBM PC ,you have to a file of 128 intergers into a character array of 256 characters . Which statement you use ?
char buf[256];int word[128]'int i;i varies from 0 to 255 in steps of 2
a) word[i]=buf[i+1]*0x100 + buf[i];b) word[i]=buf[i]*0x100 +buf[i+1];c) word[i/2] = buf[i] *0x100 + buf[i+1];d) word[i/2]=buf[i+1]*0x100 +buf[i];
16 If i=5, what is the output for printf( " %d %d %d", ++i,i,i++);
a) 5,6,7 b) 6,6,7 c) 7,6,5 d) 6,5,6
17 For the following code how many times the printf function is executed
int i,j ; for(i=0;i<=10;i++); for(j=0;j<=10;j++); printf("i=%d,j=%d\n",i,j); a)121 b) 11 c) 10 d) None of the above 18 What is the output generated for the following code#define square (a) (a*a)printf("%d",square(4+5)); a) 81 b) 4 C) 29 D) None of the above 19 For the following statement find the values generated for p and q? int p = 0, q =1;p = q++;p = ++q;p = q--;p = --q; The value of p and q are:-a) 1,1 b) 0,0 c) 3,2 D) 1,2 20 What is the output generated by the following program ?#includemain(){ int a , count; int func(int); for (count = 1 ;count <=5;++count) { a = func(count); printf("%d", a); }} int func(int x) { int y; y=x*x; return(y);A) 1234567 b) 2516941 C) 9162514 D) 14916251. Helmet:Head::? ans: Breakplate:chest2. Writer:Pen::? ans:Carpenter:Saw3. cargo:lorry::?4. In one shocking instance of ________________ research, one of the nations influential researchers in the field of genetics reported on experiments that were never carried out and published deliberately_________ scinetific papers on existed work.ans: Fradulent- deceptive5. We need more men of culture eligitent we have too many ____ among us ans: philistines6. Hide-bound choose nearest antonym ans: Open minded7. She has been in her Bonnet She cantell _____ ans:Anto8.If x-2y=2;2x+y=4 which of the following is right ans:d9. If 2men and 7boys can do a work in 16days.3men and 8boys can do in12 days 8menand 8boys ? ans;610. Aperson wants 30% discount. But shopper gave 20% and 12%succesively discount then the person gets ans:29.611. The distance between A and B stations is 110 km. apart on a st.line. One train starts at A at 7am. and travels towards B at 20kmph. Another starts at B at 8am.and travels towards A at a speed of 25kmph. AT what time they will meet? ans:10am. 12. 2,2,6,52.5,157.5,630 find the wrong number ans: replace 52.5 by 4513. 02,12,28,722,152,312,632 find the wrong number ans. replace 28 by 3214. Air resistance is proportional to square of the velocity at a speed of 3kmph. the resistance is 0.000045 gm/cm. An aeroplance is travelling at a speed of 250 kmph. What is the air resistance offered in kg/mit ans:0.0312515. A person gives 10% discount and he revenues 10% in bargaining. The printed price is 330. What is actual price? ans:27016. For what period of time for 1800 at 5% interest will give interest of 390% ans:13/317. 10 years back thef father age is 7 times of his son. After 2 years twice the age of the father is equal to 5 times of the son. What aretheir ages? ans;f->38,S->1418. Train travels 100km. in first 2hrs. and 200 km. in 3hrs. and 150 km. in 2.5hrs. What is the avg. speed? ans;60kmph19. A number when divided by 342 gives remainder 47 When the same number is divided by 19,what would be the remainder ? ans:920. A and B can do work in 6 days. B alone can do in 16 days. After 3 days of combined work B left. In how many days further A completes remaining work? ans:24/5 days21. In a parking place there are 36 vehicles. After first one scooter is there. AFter 2nd car two scooters, after 34d car and so on.How many scooters are there in second half of the row? ans; (YOU PLEASE DO THIS PROBLEM)22. How many times do the hands of clock coincide in a day? ans;2223. Fraction and simplification one problem is there. The exact answer is 7/13.(this damn correct)24. The least/greatest 4 digit numbers which when divided by 15,27,35,42 leaves in each case a remainder 7 is ans: 1897,9457THERE IS SEPERATE SECTION FOR CRITICAL REASONING(GMAT TYPE) 6 QUESTIONS LIKE THE FOLLOWING.25. All fans are vans. No vans are fans26.All young scientists are optimistic. All optimists are open minded.27. Assertion: Comets belong to the solar family. REason: Comets burst into pieces and revolve around the sun ans; Both A&R are true but R is not

1)A"s place is 7th from left .B"s position is 9th from the right.After interchanging their position A"s position is 11th from the left.Howmany candidates are there? 19(ans)
2)program:step 1:x=3D0,A=3D0,B=3D1;step2:If x<10;do y="3DA+B;A="3DB,B="3DY;step" x="3D4" x="3Dx+3" x="3D5,A="3D0,B="3D1" pv="3DK" ab="AC">AC+BC2. Ten years ago the father's age is seven times the son's age. Two years later father's age is twice the son's. Then thefind the ages.3. The father's age is 3 times the son's. After 15 years its age becomes twice the son's. Find the son's age now.4. Two times which are started from stations A and B which are seperated by 110 km. One train leaves station A at 7 am. and travels 20 kmph. The other train leaves station B at 8 am. Will speed of 25 kmph. Then at what time will they meet if they are travelling in opposite direction.a) 7 am. b) 10 am. c) 12 noon. d) 11 am.5) x+2y=2 , 2x-y=4 then i)x=2 ii)x=0 y=0 iii) x-y=2a)i only b) ii only c) none d)i and ( ) only6) In a family E is the father of two sons and a daugher who is unmarried. Daugher in-law is an officer whose brother_in_law Ais Engineer. C is doctor. The sister of B is Violenist who learnt Violin from B's wife. Then6) What is the relationship between A&B. (ans. brothers)7) Who is the wife of B (ans. officer)8) What is the relation between E&B. (ans. father and son)9) In a word COINCIDENCE the 1st letter is interchanged with 3ed letter and 2nd letter with 4th and so on. So what is the seventh letter from the right after interchanging. ans is D.10) Minmise 123658/234586= (ans is 0.52)11) A and B can do a work in 6 days. B alone can do in 16 days.After 3 days B withdraws. Then how many days can be needed by Ato do the work alone. 12) Two men and Three boys can do a work in 6 days. 3 men and 5 boyscan do that work in 4 days. Then 8 men and 8 boys can do in how many days.13) 123 means LITTLE BRIGHT BOY and 435 means GIRL IS BRIGHT and 267 means LITTLE THING LLOGAL . Then LITTLE is represented by_______. ans is 2.14 to 17 ( R.S Agarwal suggested ) On same relation like HELMET-HEAD then HIDE _ ? ( BOUND ans.)18to 22 Assertion and reason following (R.S Agarwal suggested)23 to 25 Having the opposite meaning of relation given (ENGLISH)25 TO 30 Statements30 to 35 ---> Figuring NON VERBAL36 TO 38 ----> A simillarity between two figures is given.You have to find the same simillar figure from the choice.39 to 41 ----> Correction of sentences.42. How many times a minute & hours hands will meet together in a day. ans. 22 times.43. In a total of 36 vehicles after one car there is one scooter. After 2nd car there will be two scooters and after 3ed car there will be 3 scooters so on . then find the number of scooters in the right half of arrangement. ans. 13 check.44. All Hoopes are Dupes. All fears are liars so i) All hoopes are fears ii) All dupes are liars45. & 46. like above.47). Find the statement which gives correct explanartion to the contradictory statements. i). doctor told that "Drug adicts can not have their habit ii). some surveys indicate that all the drug addicts left their drug habit. a) . Doctor do not know about drug addicts. b). servays does not include every drug addict c). Drug addiction is a bad habit. d). will power make people leave their habbit.48 to 54. - - a - b b a - b - c like this. [ simple Qns from R.s.agarwal] 55. A shop keeper selling a product for 10% discount to the market price. but by bourgaining he got 10% profit of the costprice. Market price is 300Rs. Find the cost price.56. Customer needs 30% discount . But shopkeeper give 20% and 10% succesively. Then a). Whether customer got less profit than what he needed. b).will he got more. c). no loss d). none57. Cost price of two articles is 800. If he sells one article at 3/4 th of cost price and another article at 4/3 rd of cost price Then he will loss 12 Rs. Then SP of article is. a). 600,400 b). 500, 400 c). 500,500 d). none58 What is the longest four digit numbr which when divided by 12,17,35 leavining same remainder 5a) 8825 b)8725 c) 8025 d) none59) If travels 300 meters in first two hours and next 200 mts in 3 hours and 150 meters in 2.5 hours. Find the avg speed.a) 56 b) 58 c)50 d) 60 ans) 60


APTITUDE TEST
20 QUESTIONS;2 MARKS EACH
TIME-20MINUTES
1) ONE RECTANGULAR PLATE WITH LENGTH 8INCHES,BREADTH 11 INCHES AND
2 INCHES THICKNESS IS THERE.WHAT IS THE LENGTH OF THE CIRCULAR ROD
WITH DIAMETER 8 INCHES AND EQUAL TO VOLUME OF RECTANGULAR PLATE?
ANS: 3.5INCHES
2) WHAT IS THE NUMBER OF ZEROS AT THE END OF THE PRODUCT OF THE NUMBERS
FROM 1 TO 100
3) in some game 139 members have participated every time one fellow will
get bye what is the number of matches to choose the champion to be
held?
ans: 138
4) one fast typist type some matter in 2hr and
another slow typist type the
same matter in 3hr. if both do combinely in how much time they
will finish.
ans: 1hr 12min
5) in 8*8 chess board what is the total number of squares
refer odel
ans:204
6) falling height is proportional to square of the time.
one object falls 64cm in 2sec than in 6sec from how much
height the object will fall.
7) gavaskar average in first 50 innings was 50 . after the 51st
innings his average was 51 how many runs he made in the 51st
innings
8)2 oranges,3 bananas and 4 apples cost Rs.15 . 3 ornages 2 bananas
1 apple costs Rs 10. what is the cost of 3 oranges, 3 bananas and
3 apples ANs Rs 15.
9)in 80 coins one coin is counterfiet what is minimum number of
weighings to find out counterfiet coin
10)in a company 30% are supervisors and 40% employees are male
if 60% of supervisors are male. what is the probability
that a randomly choosen employee is a male or female?
11)statement: all green are blue are blue, all blue are white
conclusion:
I) some blue are green II) some white are green
III)some green are not white IV) all white are blue
a) he has given four choices like gre type
12)all teachers are students. some students are girls.
this type of questions are there.
we cant able to reproduce them.:wq
D.E.shaw 1997
SECTION B (all multiple choices)
(each q carries 3 marks)
1.while((*p++=*q++)!=0){}
is equal to
a) b) c) d)
2.the function strcmp(str1,str2) returns
3. int *x[](); means
4.#define PRINT(int) printf("int=%d",int);
main()
{int x,y,z;
x=03;y=-1;z=01;
PRINT(x^x);
z<<=3;PRINT(x); y>>=3;PRINT(y);
}ans 0,3,-1
5. struct list{
int x;
struct list *next;
}*head;
the struct head.x =100
above is correct / wrong ans:wrong
6. '-'=45 '/'=47
printfr(%d/n,'-','-','-','-','/','/','/');
o/p =? ans:45
12.o/p=?
int i;
i=1;
i=i+2*i++;
printf(%d,i);
8.{ ch='A';
while(ch<='F'){ switch(ch){ case'A':case'B':case'C':case'D':ch++;continue; case'E':case'F':ch++; } putchar(ch); } } a)ABCDEF b.EFG c.FG d.error ans:C 9. FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b.'B' c.'A' d.'C' ans:b 10. int a=1; b=2; c=3; *pointer; pointer=&c; a=c/*pointer; b=c; printf("a=%d b=%d",a,b); a. a=1 b=3 b a=3 b=3 c 3 2 d. error ans:d 11.#include
char *f()
{char *s=malloc(8);
strcpy(s,"goodbye")}
main()
{
char *f()_;
printf("%c",*f()='A');
o/p=?
13. int sum(n)
int n;
if(n<1)return>(y)?(x):(y)
{ int i=10;j=5;k=0;
k= MAN(i++,++j)
printf("%d %d %d" ,i,j,k)} ans 12 6 11
16) a=10;b=5; c=3;d=3;
if(a
show(int t,va_list ptr1)
{
int a,x,i;
a=va_arg(ptr1,int)
printf("\n %d",a)
}
display(char)
{int x;
listptr;
va_star(otr,s);
n=va_arg(ptr,int);
show(x,ptr);
}
main()
{
display("hello",4,12,13,14,44);
}
a) 13 b) 12 c) 44 d) 14
.............................................
17. if the following program (my prog)
main(int size of ,char *arg[])
{ while(size of arg) printf("%s",arg[--size of arg)
}
is run from the command line as myprog jan feb mar apr
what would be the o/p
a)myprog jan,feb,mar,apr
b)rev
c)jan,feb,mar,apr
d)error ans:b
.............................................
18.what is o/p
main()
{int i=3;
while(i--)
{
int i=100
i--;
printf("%d..",i);
}
}
a) infinite loop
b) error
c) 99..99..99..99
d) 3..22..1.. ans :c
.............................................
20)what is the o/p of the program
#define rows 3
#define colums 4
main()
{
int a[rows][colums]={1,2,3,4,5,6,7,8,9,10,11,12};
i=j=k=99;
for(i=0;imain(){ int a[] ={ 1,2,3,4,5,6,7};char c[] = {' a','x','h','o','k'};printf("%d\t %d ", (&a[3]-&amp;a[0]),(&c[3]-&c[0]));}ans : 3 3
3. what is the output of the program?
#includemain(){struct s1 {int i; };struct s2 {int i; };struct s1 st1;struct s2 st2;st1.i =5;st2 = st1;printf(" %d " , st2.i);}
ans: nothing (error)expl: diff struct variables should not assigned using "=" operator.

4.what is the output of the program?
#includemain(){int i,j;int mat[3][3] ={1,2,3,4,5,6,7,8,9};for (i=2;i>=0;i--) for ( j=2;j>=0;j--)printf("%d" , *(*(mat+j)+i));}
ans : 9 6 3 8 5 2 7 4 1
5.
fun(n);}int fun( int n){int i;for(i=0;i<=n;i++)fun(n-i);printf(" well done"); } howmany times is the printf statement executed for n=10? ans: zeroexpl: Befire reaching to printf statement it will goes to infinite loop. 6.what is the output of the program? main(){struct emp{ char emp[]; int empno; float sal;};struct emp member = { "TIGER"};printf(" %d %f", member.empno,member.sal); ans: error. In struct variable emp[], we have to give array size. If array size givenans is 0, 0.00 7. output of the program? # define infiniteloop while(1) main() { infiniteloop; printf("DONE");} ans: noneexpl: infiniteloop in main ends with ";" . so loop will not reach end;and the DONE also will not print. 8. output of the program? main(){int a=2, b=3;printf(" %d ", a+++b);} ans:5expl: here it evaluates as a++ + b. 9. output of the program? #define prn(a) printf("%d",a)#define print(a,b,c) prn(a), prn(b), prn(c)#define max(a,b) (a temp $wc -l temp (a) 9 (b) 10 (c) 11 (d) undefined. ans : b *c 3. If one wants the output of one command( command1) to be printed inthe printer as well as to be added to another file (outfile) which one of the following is a currect command he can give? (a) $command1 >>outfiletee lpr (b) $tee -a command1 lpr (c) $ command1 tee outfile lpr (d) $ command tee -a outfile lpr ans : d (4) In the shell program set -x will cause A. Execution of the commands in the background B. Execution of the commands in verbose mode C. Exit from the shell program. D. Exit from the shell program after executing the next command ans:b (5) ACL in UNIX refers to A. Acces Control List B. Action Control List C. Application Command Language D. Advanced C lanuage ans a: (6) The command echo* A. will print * on the screen B. will print contents of all the files in the current directory C. will list the files in the current directory D. will print the contents of all shell variables ans c: (7) ls date will A. print the name of the files in the current directory B. print today's date and time C. (A) followed by (B) D. none of the above ans : a (8) The built-in shell variable $$ refers to A. printing numbers in dollar format B. proces id_ of last command C. proces id_ of last background command issued D. proces-id of current shell ans :d (9) dd is mainly used for A. dealing with raw, unformated data, whatever the source B. dealing with data dictionary C. deleting a directory D. none of the above ans :d (10) vis in UNIX is A. a command that takes only one input B. a command for deleting strange or unwanted charectors that may have crept into files. C. points non-printable characters in understandable format D. all of the above (11) Which of the following is true regarding the UNIX (i) Multiuser Operating System (ii)Multitasking Operating System (iii) Real timing Operating System A. i only B. i and ii only C. i and ii and iii only D. i and ii ans : a (12) ln command is used to A. link object codes into a executable code B. give two names to the same file C. set line numbers for the file D. none of the above ans : b (13) nohup command is used for A. protecting the execution of programmes from aborting when hangup signal is received B. changing the execution priority of the programes C. not hanging up of the modem D. disconnecting a node from the system ans : a (14) SCCS is a A. Tool for maintaining large programmes in a production environment B. Communication Protocol C. Shell Programming Language D. String processing utility ans : a (15) Which one of the following is true as long as UNIX is concerned A. One can do programming in C only B. It can support terminals capable of printing only uppercase characters C. The text files are sorted as it is in MS-DOS D. None of the above ans: d (16) Inside vi editor to replace the string 10/$$/92 with 10/$$/92 globally the following command can be used A. :1,$ s/\/10\/\$\/94/10\/\$\$\/92/g B. :1,$ s/\/10\/\$\/94/10\/\$\/$92/ C. :s10/$$/92/10/$$/92/g D. :1,$ s/\/10\/$\/94/10\/$$\/92/g**** ans : d
(17) The ed command without any argument A. will print the current working directory B. will make the home directory as current directory C. will ask for the directory to be used as the current directory D. will go to the previous directory (18) nice command is used A. to increase/decrease execution priority of a command B. to compress a file C. to run a programme at latter time D. to set the key board responce slower ans : a (19) What will be the output of the following command sequence $ x='I am x' $sh $echo $x A. I am x B. Blank line C. x D. None of the above ans :b (20) The command tr a-z 0-9 <>(y)?(x):(y) main() { intx=5,y=5; printf("maximum is %d",MAX(++x,++y)); } the outpput of the programis a)maximum is 7 (b)maximum is 5 (c)maximum is 6 d)none of the above 2)given the following definitions int *p,*q,r; int values[30]; p=&values[0]; q=values+29; r=++q-p; what will be the value of r ? a)address of q minus p b)number of elements in the array c)(value pointed by q)+1-(value pointed by p) d)none of the above 3)what will the output of the program? #include //print the sum of the series 1/5+1/4+.... static int =5; main() { int sum=0; do { sum+=(1/i); }while(0main(){ intoldvar=80;newvar=-80; int swap(int,int); swap(oldvar,newvar); printf("numbers are %d\t%d",newvar ,oldvar); } int swap(intolval,int neval) { int temval=olval; olval=neval; neval=temval; } the output of the program isa)numbers are 80-80b)numbers are 80 80c)numbers are -80 80d)numbers are -80 -80
5 STUDY THE PROGRAM BELOW, WHICH OF THE FOLLOWING STATEMENT WILL MAKEPROGRAM WORK :- main () { int *! = 10 , *j=20; i=i*j; }
A) Replace i = i*j; as i = (int) ((int) i * (int)j);B) No errorC) Replacei= i*j;as i = (int*) ((int)i*(int)j);D) Replace i+i*j ; as i = (int) i* (int)j;
6 Study the following program #includeenum mode = {green,red,orange,blue ,white};main (){ green = green +!; printf("%d,%d",green,red );
}
The output of the program will be :-
A) 1,1 B) 0,1 C) No output, error in compilation d) None of the above
7 Study th following statements.
#define DELAYTIME 1000volatile extern int k;intj;
for (i=0;imain(){char buff[] = "this is a test";int i, *ptr;ptr = (int*)buff;for (i=0;*ptr; i++);printf("%c",*ptr++);}
The following will be the output
A) This is a test B) It'll print junk C) Compilation errorD) None of the above
9 Select the explanation for the following declaration itn (*(*ptr)(int)) (void)A) ptr is apointer pointing to a integer function that takes an intvalues returns an integer which will points to a function with no argument.B) ptr is pointer to function that takes an int value returns a pointer to a function with ano argument which returns a integer c) This is not a valid C statement.D) None of the above. 10 Study the following program
# include char *c[] ={ "FILE", "EDIT", "SEARCH", "COMPILE", }; HAR **cp[] = {c+3,c+2,c+1,c};char ***cpp = cp;main(){ printf("%s", **cpp); printf("%s"< *--*++cpp+3); printf("%s", *cpp[-2]+3); printf("%s\n",cpp[-1][-1]+1); } The output of this program is A) SEARCHFILEEDITCOMPILE B) SEARCHCOMPILEEDITC) SEARCHEPILEDIT D) None of the above 11 What is the size of ptr1 and ptr2. struct x { int j; char k[100]; unsigned i;};int *ptr1:struct X *ptr2; A) Same depending on the model used B) 2,104C) 2, Undefined for memory is not allocated D) 2,4 12 If i = i * 16; Which of the following is a better approach to do the operationA) Multiply i by 16 and keep it B) Shift left by 4 bitsC) Add i 16 times D) None of the above 13 What is the output of the following program #includemain(){int i = 0;switc(i) {case 0 : i++; case 1 : i++2;case2 : ++i;}printf("%d",i++);}
output of the program :-A) 1 B) 3 C) 4 D) 5
14 In the following , where means
lseek(fd,0L,SEEK_END);where = tell(fd);A) End of file. B) Head of file C) Cannot be definedD) In between head and end of file.
15 Assuming that you are using IBM PC ,you have to a file of 128 intergers into a character array of 256 characters . Which statement you use ?
char buf[256];int word[128]'int i;i varies from 0 to 255 in steps of 2
a) word[i]=buf[i+1]*0x100 + buf[i];b) word[i]=buf[i]*0x100 +buf[i+1];c) word[i/2] = buf[i] *0x100 + buf[i+1];d) word[i/2]=buf[i+1]*0x100 +buf[i];
16 If i=5, what is the output for printf( " %d %d %d", ++i,i,i++);
a) 5,6,7 b) 6,6,7 c) 7,6,5 d) 6,5,6
17 For the following code how many times the printf function is executed
int i,j ; for(i=0;i<=10;i++); for(j=0;j<=10;j++); printf("i=%d,j=%d\n",i,j); a)121 b) 11 c) 10 d) None of the above 18 What is the output generated for the following code#define square (a) (a*a)printf("%d",square(4+5)); a) 81 b) 4 C) 29 D) None of the above 19 For the following statement find the values generated for p and q? int p = 0, q =1;p = q++;p = ++q;p = q--;p = --q; The value of p and q are:-a) 1,1 b) 0,0 c) 3,2 D) 1,2 20 What is the output generated by the following program ?#includemain(){ int a , count; int func(int); for (count = 1 ;count <=5;++count) { a = func(count); printf("%d", a); }} int func(int x) { int y; y=x*x; return(y); A) 1234567 b) 2516941 C) 9162514 D) 1491625 Dear Sarma,The follwing qustions were given in the exam conducted by them in KGP.IIT.recently. 1. Helmet:Head::? ans: Breakplate:chest2. Writer:Pen::? ans:Carpenter:Saw3. cargo:lorry::?4. In one shocking instance of ________________ research, one of the nations influential researchers in the field of genetics reported on experiments that were never carried out and published deliberately_________ scinetific papers on existed work.ans: Fradulent- deceptive5. We need more men of culture eligitent we have too many ____ among usans: philistines6. Hide-bound choose nearest antonymans: Open minded7. She has been in her Bonnet She cantell ______ans:Anto8.If x-2y=2;2x+y=4 which of the following is rightans:d9. If 2men and 7boys can do a work in 16days.3men and 8boys cand do in12 days 8menand 8boys ?ans;610. Aperson wants 30% discount. But shopper gave 20% and 12%succesivelydiscount then the person getsans:29.611. The distance between A and B stations is 110 km. apart on a st.line. One train starts at A at 7am. and travels towards B at 20kmph. Another starts at B at 8am.and travels towards A at a speed of 25kmph. AT what time they will meet? ans:10am. 12. 2,2,6,52.5,157.5,630 find the wrong number ans:replace 52.5 by 4513. 02,12,28,722,152,312,632 find thef wrong numberans. replace 28 by 3214. Air resistance is proportional to square of the velocity at a speedof 3kmph. the resistance is 0.000045 gm/cm. An aeroplance is travelling at a speed of 250 kmph. What is the air resistance offered in kg/mitans:0.0312515. A person gives 10% discount and he revenues 10% in bargaining. Theprinted price is 330. What is actual price?ans:27016. For what period of time for 1800 at 5% interest will give interestof 390% ans:13/317. 10 years back thef father age is 7 times of his son. After 2 yearstwice the age of the father is equal to 5 times of the son. What aretheir ages?ans;f->38,S->1418. Train travels 100km. in first 2hrs. and 200 km. in 3hrs. and 150km. in 2.5hrs. What is the avg. speex?ans;60kmph19. A number when divided by 342 gives remainder 47 When the same number is divided by 19,what would be the remainder ?ans:920. A and B can do work in 6 days. B alone can do in 16 days. After3 days of combined work B left. In how many days further A completesremaining work?ans:24/5 days21. In a parking place there are 36 vehicles. After first one scooteris there. AFter 2nd car two scooters, after 34d car and so on....How many scooters are there in second half of the row?ans; (YOU PLEASE DO THIS PROBLEM)22. How many times do the hands of clock concide in a day?ans;2223. Fraction and simplification one problem is there. The exact answeris 7/13.(this damn correct)24. The least/greatest 4 digit numbers which when divided by 15,27,35,42 leaves in each case a remainder 7 isans: 1897,9457THERE IS SEPERATE SECTION FOR CRITICAL REASONING(GMAT TYPE) 6 QUESTIONSLIKE THE FOLLOWING.25. All fans are vans. No vans are fansans :26.All young scientists are optimistic. All optimists are open minded.ans:27. Assertion: Comets belong to the solar family. REason: Comets burst into pieces and revolve around the sunans; Both A&R are true but R is not
Correct the sentence questions 4.
8 figures are there. Among these for 4 problems you have to find the next figure. for remaing you have find odd figure.(ALL ARE EASY )
ONE ANALYTICAL QUESTION AS FOLLOWS (THIS ALSO VERY EASY)
five people in a family named A,B,C,D,E.probable answers confirm by reading the question carefully.ans: A,B -sonsdoctor C -daughterofficer D - daughter in law ie. wife of B
using this you have to solve five questions. that is very easyif you confirm the above.
ie. don't confuse with the sentance who learns music. he clearly mension that daughter in law is offcier. he also mension that A is brother in law of officer. And C is a doctor.

(dbss paper)> VERBAL> ANTONYMS> 8 INCENCE> A)SOOTHE B)DOLE C) PSYCHIC D) BABBLE E) BICKERING > 9 IMPETUOUS> A) INVENTIVE B)SUMPTUOUS C)IMPATIENT D)THOUGHTFUL E)RELIABLE> 10 DEPRECATE> A)ATTACK B)PRAISE C)CRITICIZE D)REDUCE E)BRIGHTEN> > SYNONYMS> > 11)PLACATE> A)WASH B)CHANGE C)CALM D)INFURIATE E)CONCILIATE> 12 HARBINGER> A)ANNOUNCEMENT B)DOCK WORKER C)LOVER D)PRECURSOR E)FORERUNNER> 13 EMBELLISH> A)EMBOSS B)SKETCH C)CLOTHE D)DESIGN E)GARNISH> THE SENTENCES BELOW ARE DIVIDED INTO FOUR PARTS .SELECT THE PART WHICH HAS AN ERROR> > 14 A)THE REASON FOR > B)THE DELAY IS BECAUSE C)WE HAVE HAD DIFFICULTY D)IN OBTAINING MATERIALS> > 15 A)THE NUMBER OF PEOPLE B)WHO OWN PERSONAL COMPUTERS> C)ARE INCREASING D)EVERY YEAR> > SUPPOSED ANSWERS(BUT NOT SURE CHECK EVERY QUESTION IN DICTONARY OR WORDLISTS> > 8)A 9) 10)B OR E 11)C 12)E 13)D 14)B 15)B> > THESE ARE ONLY AVAILABLE IN VERBAL .REMAINING ARE QUANT> QUANT:-> > 56 IF THE PRICE OF SUGAR RAISES BY 20%,AHOUSE HOLDER MST REDUCE HIS CONSUMPTION> OF SUGAR BY WHAT % SO AS NOT TO INCREASE HIE EXPENDITURE> A)12.5% B)15% C)16> C)16 2/3% D)20%> > 57 THE PRESSURE OF A CERTAIN MASS OF A GAS VARIES INVERSELY AS ITS VOLUME.> WHEN P(MEASURED IN KGWT.PER SQ DECIMETER)IS 20,THEN V(MEASURED IN CUBIC DECIMETER)IS 450.FIND IN KGWTPER SQ DECIMETER THE PRESSURE WHEN THE VOLUME IS 300 > CUBIC DECIMETERS.ALSO FIND THE VOLUME WHEN THW PRESSURE IS 60 KG WT PER SQ DECIMETER(N CUBIC DECI METER)> A)30,150 B) 40,160 C)50,170 D)60,180 E)NONE> > 58 IN HOW MANY OTHER WAYS CAN THE LETTERS OF THE WORD DOGMATIC BE RE-ARRANGED> A)40320 B)40321 C)20132 D)40319 E)NONE> > 50 AT A CERTAIN ,MOMENT A WATCH SHOWS A 2 MIN LAG ALTHOUGH IT IS FAST.IF IT> SHOWED A 3 MN LAG AT THAT MOMENT BUT GAINED HALF A MIN MORE A DAY THAN IT DOES,> IT WOULD SHOW THE TRUE TIME 1 DAY SOONER THAN IT USUALLY DOES.HOW MANY MIN> DOES THE WATCH GAIN PER DAY> A)0.2 B) 0.75 C)0.5 D)0.4 E)0.3> > 60)IF 29 IS ADDED TO 1/4 AND 1/3 OF A NUMBER ,THEN THE FIRST SUM WILL BE 1 LESS THAN 3/2 OF THE NUMBER AND THE SECOND ONE WILL EXCEED 1.5 TMES OF THE NUMBER BY ONE.FIND THIS NUMBER IF IT IS KNOWN TO BE AN INTEGER> A)24 B)48 C)32 D)27> > 61) A NUMBER CONSISTS OF THREE DIGITS WHISE SUM IS 10.THE MIDDLE DIGIT IS EQUAL TO SUM OF THE OTHER TWO AND THE THE NUMBER WILL BE INCREASED BY 99 IF THE FIRST AND THIRD DIGITS BE INTERCHANGED.THE NUM IS> A)154 B)361 C)253 D)NONE> > 62)TEN YEARS AGO THE FATHER WAS 7 TIMES AS OLD AS HS SON,TWO YEARS HENCE TWICE HIS AGE WILL BE EQUAL TO 5 TIMES HIS SON'S.WHAT ARE THEIR PRESENT AGES> A)38,14 B)40,20 C)52,26 D)NONE> > 63)TWO PIPES A AND B CAN FILL A SISTERN IN 30 AND 40 MIN RESPECTIVELY.THIRD> PIPE C CAN DRAW OFF 60 LIT OF WATER PER MIN.IF ALL 3 PIPES ARE OPENED,THE CISTERN FILLS IN 1 HOUR.WHAT IS THE CAPACITY OF THE CISTERN> A)995 LT B)1000 LT C)1100 LT D)1200 LT E)1440 LT> > 64)MACHINE A PRODUCES 100 PARTS TWICE AS FAST AS MACHINE B DOES.MAC B PRODUCES 100 PARTS IN 40 MIN .IF EACH MACH PRODUCES PARTS AT A CONST RATE ,HOW MANY PARTS DOES MACH A PRODUCE IN 6 MIN> A)30 B)25 C)20 D)15 E)7.5> > 65) A NECKLES IS MADE BY STRINING N INDIVIDUAL BEATS TOGETHER IN THE REPEATING PATTERN RED BEAD,GREEN BEAD,WHITE BEAD,BLUE BEAD AND YELLOW BEAD.IF THE NECKLES> DESIGNED BEGINS WITH A RED BEAD AND ENDS WITH A WHITE BEAD,THEN N COULD EQUAL> A)16 B)32 C)41 D)54 E)68> > 66)A RAILWAY TRAIN 140 M LONG TRAVELLING AT 90 KMPPH WILL OVER TAKE ANOTHER TRAIN OF LENGTH 160 M MOVING IN THE SAME DIRECTION AT 72 KMPH IN WHAT TINE> A)2 MIN B)1MIN C)3 MIN D)NONE> > 67)TWO PERSONS A AND B ARE 200 KM APART.A TRAVELLS BY CAR IN THE DIRECTION OF B> AT A SPEED OF 60 KMPH.B STARTS AT SAME TIME AND TRAVELLS BY MOTORCYCLE AT 40 KMPH TOWORDS A.AFTER HOW MUCH TIME THEY WILL MEET> A)2 HRS B)3 HR C)4 HR D)NONE> > 68)IN 1937 ,A MAN STATED THAT HE WAS X YEARS OLD IN THE YEAR X**2.HE ADDED,"> IF X IS ADDED TO THE MEMBER OF MY MONTH OF BIRTH,THE RESULT EQUALS THE SQUARE OF THE MONTH ON WHHICH I WAS BORN".WHEN WAS HE BORN?> A)7/5/1892 B)6/11/1892 C)18/1/1890 D)30/8/1893> > 69 IN A FACTORY THE RATIO OF MALE WORKERS TO FEMALE WORKERS WAS 5:3.IF THE> NUMBER OF FEMALE WORKERS WAS LESS BY 40,WHAT WAS THE TOTAL NUMBER OF WORKERS> IN THE FACTORY> A)120 B)160 C)180 D)NONE> > 70) 18 MEN CAN BUILD A WALL 140 M LONG IN 42 DAYS.WITH THE SAME RATE,THE NUMBER OF DAYS THAT 30 MEN REQUIRED TO CONSTRUCT A SIMILAR WALL 100 M LONG IS> A)16 B) 17 C)18 D)NONE> > 71) SIX PARTS OF MILK ARE MIXED WITH 1 PART OF WATER,5 LIT OF WATER ARE ADDED TO THE MIXTURE AND IT IS THEN FOUND TO CONTAIN 5 TIMES AS MUCH MILK AS WATER.> HOW MANY LIT OF MILK WERE THERE IN THE MIXTURE FIRST> A)16 B)20 C)25 D)NONE> > 72)A PERSON CLOSES HIS A/C IN A BANK BY WITH DRAWING RUPEES 11000.ONE YEAR EARLIER HE HAD WITHDRAWN RS 6500.TWO YEARS EARLIER HE HAD WITHDRAWN RS 12000.HOW> MUCH MONEY HAD HE DEPOSITED AT THE TIME OF OPENING THE A/C 3 YEARS EARLIER,IF> THE ANNUAL SIMPLE INTEREST RATE WAS 10%> A)20000 B)25000 C)27500 D)22500> > 73)FIND THE GREATEST NUMBER OF 4 DIGITS WHICH WHEN DIVIDED BY 15,20 AND 28 LEAVES> IN EACH CASE A REMAINDER 2> A)9662 B)9077 C)1090 D)NONE> > 74) REDUCE 116690151/427863887> A)2/7 B)7/9 C)3/11 D)9/13> > 75)ARUN AND RAMU ARE FRIENDS.ARUN BORROWED A SUM OF RS 400 AT 5% PER ANUM SIMPLE> INTEREST FROM RAMU.HE RETURNS THE AMOUNT WITH INTEST AFTER 2 YEARS.RAMU RETURNS TO ARUN 2% OF THE TOTAL AMT RETURNED.HOW MUCH DID ARUN RECEIVE> A)9.20 B)7.60 C) 8.80 D)NONE> > PROBABLE ANS:56) 57)A 58)A 59) 60)A 61)C 62)A 63)E 64)A 65)E 66)B 67)A 69)B 72)B73)D 74)C 75)C > > IN EACH CASE A REMAINDER O> > 53) cc_ccdd_d_cc_ccdd_dd> a)d,c,d,c,c b)d,c,d,d,c c)d,c,c,d,d d)None> > 54) abab_b_bcb_dcdcded_d> a)abcd b)acce c)abde d)bcde> > 55) baab_c_bcbdc_dc_dded> a)abcd b)bcde c)dcbe d)abce>

0 Comments:

Post a Comment

<< Home