Anda di halaman 1dari 15

TCS Placement Paper Hyderabad with Answers and Solutions 1.

Consider the following program main() { unsigned int i=10; while(i>=0) { printf("%u",i) i--; } } How many times the loop will get executed (a)10 (b)9 (c)11 (d) infinite 2.Pick out the odd one out (a) malloc() (b) calloc() (c) free() (d) realloc() 3. Which of the following involves context switch, (a) system call (b) privileged instruction) floating point exception) all the above (e) none of the above Ans: (a) 4. In OST, terminal emulation is done in (a) sessions layer b) application layer c) presentation layer (d) transport layer Ans: (b) 5. What is the output of the following program main() { int a=10; int b=6; if(a=3) b++; printf("%d %d\n",a,b++); }

a) 10,6 b)10,7 c) 3,6 d) 3,7 e) none Answer : d) 3,7 6. What can be said of the following program? main() { enum Months {JAN =1,FEB,MAR,APR}; Months X = JAN; if(X==1) { printf("Jan is the first month"); } } a) Does not print anything b) Prints : Jan is the first month c) Generates compilation error d) Results in runtime error Answer: b) Prints : Jan.. 7. In a class 3/5 of the students are girls and rest are boys. If 2/9 of the girls and ? of the boys are absent. What parts of the total number of students are present? (1) 23/30 (2) 23/36 (3) 18/49 (4) 17/25

8. The maximum number of students among whom 1001 pens and 910 pencils can be distributed in such a way that each students gets same number of pens and same number of pencils. is : (1) 91 (2) 910 (3) 1001 (4) 1911 9. In a town, the population was 8000. In one year, male population increased by 10% and female population increased by 8% but the total population increased by 9%. The number of males in the town was:

(1) 4000 (2) 4500 (3) 5000 (4) 6000 10. In an examination, there were 1000 boys and 800 girls. 60% of the boys and 50% of the girls passed. Find the percent of the candidates failed? (1)42.6 (2) 48.4 (3) 44.4 (4) 49.6 Infosys Placement Paper Hyderabad with Answers and Solutions 1. union u { struct st { int i : 4; int j : 4; int k : 4; int l; }st; int i; }u; main() { u.i = 100; printf("%d, %d, %d",u.i, u.st.i, u.st.l); } a. 4, 4, 0 b. 0, 0, 0 c. 100, 4, 0 d. 40, 4, 0 Ans: c) 100, 4, 0 2.

union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4

Ans: 20, 200, error for 3rd printf 3. if an article with marked price of rs.400 is sold at successive discount of 10%,25% and 15%,what is the price the customer has to pay? a.360 b.300 c.230(ans) d.270

4. if jacob sold a watch costing rs.400 to john at 15% profit and john sold the same to sudhir at 15% profit, what is the price paid by sudhir? a.460 b.510 c.529(ans) d.560

5. pqrs is a rectangle having area 50. rx=1/4sr.what is the area of pqxs? a.37.5 b.42.5 c.12 d.3

6.There are 200 questions on a 3 hr examination. Among these questions are 50 mathematics problems. It is suggested that twice as much time be spent on each Maths problem as for each other question. How many minutes should be spent on mathematics problems A.36 B.72 C.60 D.100 Ans.B 7. In a class composed of x girls and y boys what part of the class is composed of girls A.y/(x + y) B.x/xy C.x/(x + y) D.y/xy Ans.C 8. A coffee shop blends 2 kinds of coffee,putting in 2 parts of a 33p. a gm. grade to 1 part of a 24p. a gm.If the mixture is changed to 1 part of the 33p. a gm. to 2 parts of the less expensive grade,how much will the shop save in blending 100 gms. A.Rs.90 B.Rs.1.00 C.Rs.3.00 D.Rs.8.00 Ans.C 9. There are 200 questions on a 3 hr examination.Among these questions are 50 mathematics problems.It is suggested that twice as much time be spent on each maths problem as for each other question.How many minutes should be spent on mathematics problems A.36 B.72 C.60 D.100 Ans.B

10. main() { int x=5; for(;x!=0;x--) { printf("x=%d\n", x--); } } a. 5, 4, 3, 2,1 b. 4, 3, 2, 1, 0 c. 5, 3, 1 d. none of the above Ans: d) Infinite loop as x is decremented twice, it never be 0 and loop is going on & on Wipro Placement Paper Hyderabad with Answers and Solutions 1. If there are 1024*1280 pixels on a screen and each pixel can have around 16 million colors Find the memory required for this? Ans. 4MB

2. int a; int b=0; while(a) { { a&=a-1; b++; } A. a &b

B. 0 & 15 C. 1 & 16 D. 0 & 16 E. none

3. class A { public: static int a; A() {a=10}; }; int main() { A b; Printf("%d,b.a); Return 0; } will the program compile? a yes b. no

4. M men agree to purchase a gift for Rs. D. If three men drop out how much more will each have to contribute towards the purchase of the gift/

A. D/(M-3) B. MD/3 C. M/(D-3) D. 3D/(M2-3M) Ans. D

5. A company contracts to paint 3 houses. Mr.Brown can paint a house in 6 days while Mr.Black would take 8 days and Mr.Blue 12 days. After 8 days Mr.Brown goes on vacation and Mr. Black begins to work for a period of 6 days. How many days will it take Mr.Blue to complete the contract? A. 7 B. 8 C. 11 D. 12 Ans.C

6. 2 hours after a freight train leaves Delhi a passenger train leaves the same station travelling in the same direction at an average speed of 16 km/hr. After travelling 4 hrs the passenger train overtakes the freight train. The average speed of the freight train was? A. 30 B. 40 C.58 D. 60 Ans. B

7. Find the greatest no. that will divide 964,1238 and 1400 leaving remainder of 41,31 and 51 resp. a) 58 b) 64 c) 69 d) 71

8. If all 6s get inverted and become 9s , by how much will the sum of all nos. between 1 and 100 both inclusive change? a) 300 b) 330 c) 333 d) none of these

9. If all the picture cards are removed from a pack of cards, the sum of the values of the remaining is a) 55 b) 220 c) 54 d) 216

10.A batsman scores 23 runs and increases his average from 15 to 16. find the runs to be made if he wants top inc the avg to 18 in the same match. Ans: 39runs.

Wipro Placement Paper Chennai May 2012 with Answers and Solutions. 1. What is true about the following C Functions (a) Need not return any value (b) Should always return an integer (c) Should always return a float (d) Should always return more than one value 2. A memory of 20 bytes is allocated to a string declared as char *s then the following two statements are executed: s="Entrance" l=strlen(s); what is the value of l ? (a)20 (b)8 (c)9 (d)21 3. Given the piece of code int a[50]; int *pa; pa=a; To access the 6th element of the array which of the following is incorrect? (a) *(a+5) (b) a[5] (c) pa[5] (d) *(*pa + 5} 4. if an article with marked price of rs.400 is sold at successive discount of 10%,25% and 15%,what is the price the customer has to pay? a.360 b.300 c.230(ans) d.270 5. the sides of a triangle are in the ratio 37.if the perimeter is 60 cms, the longest side is a.7 b.30 c.28(ans) d.14 6. an article with cost price of 180 is sold at 15% profit. what is the selling price? a.198 b.200 c.204 d.207(ans)

7. what part of x*x is power(x,2/3)? a.60% b.66.7% c.69% d.can't say(ans) 8. There were 36 chairs. how many ways can they be placed such that all rows have equal no. of chairs and atleast three chairs are there in each row and there are atleast three rows. Ans:- 5 ways. 9. There are 27 balls, of which 1 is heavier. given a balance how many times you need to weigh to find out the odd ball. Ans:- 3 Weighs. 10. Product of three consecutive nos. 210. What is the sum of two least numbers Ans:-11.

CS Sample Paper Chennai with Answers and Solutions. 1. What is the output of the program #include<stdio.h> #include<conio.h> void main() { int i,j=20; clrscr(); for(i=1;i<3;i++) { printf("%d,",i); continue; printf("%d",j); break; } getch(); } // A. 1,20 // B. 1,20,1,20 // c. 1,2 // D. 1,2,20,20 Ans: c

2. What is the output of the program void main() { int i,j,k; i=2; j=4; k=i++>j&2; printf("%d\n",k); if(++k && ++i<--j|| i++) { j=++k; } printf(" %d %d %d",i,-j--,k); getch(); } A. 4,-3,2 B. 5,-3,2 c. 4,-2,2 D. 5,-2,2 Ans: D

3.What is the maximum number of half-pint bottles of cream that can be filled with a 4-gallon can of cream(2 pt.=1 qt. and 4 qt.=1 gal) A.16

B.24 C.30 D.64 Ans. D

4.If the operation,^ is defined by the equation x ^ y = 2x + y,what is the value of a in 2 ^ a = a ^ 3 A.0 B.1 C.-1 D.4 Ans. B

5. At a certain moment a watch shows 2 min lag although it is running fast. If it showed a 3 min lag at that moment, but also gains by 1/2 min more a day than its current speed it would show the true time one day sooner than it usually does. How many mins does the watch gain per day. a).2 b).5 c).6 d).4 e).75 4. In 400m race A gives B a start of 7 sec and beats him by 24 sec. In another race A beats B by 10 sec.the speeds are in the ratio a)8:7 b)7:6 c)10:8 d)6:8 e)12:10

6. A company contracts to paint 3 houses. Mr. Brown can paint a house in 6 days while Mr. Black would take 8 days and Mr. Blue 12 days. After 8 days Mr. Brown goes on vacation and Mr. Black begins to work for a period of 6 days. How many days will it take Mr. Blue to complete the contract? A. 7 B. 8 C. 11

D. 12 Ans. C

7. 2 hours after a freight train leaves Delhi a passenger train leaves the same station traveling in the same direction at an average speed of 16 km/hr. After traveling 4 hrs the passenger train overtakes the freight train. The average speed of the freight train was? A. 30 B. 40 C.58 D. 60 Ans. B 8. A man fixed an appointment to meet the manager, Manager asked him to come two days after the day before the day after tomorrow. Today is Friday. When will the manager expect him? (repeated from previous papers) Ans: Monday 9. if a person is sitting in a exam having 30 questions (objective type) the examiner use the formula to calculate the score is S=30+4c-w here c is number of correct answer and w is number of wrong answer , the examiner find the score is more than 80, tell how may questions are correct ? if the score is little less but still more than 80 then u wont be able to answer. Ans:- 16 10. A plane goes from Chicago to Columbus and then comes back. It takes the same time to travel in either ways. It leave Chicago early in the morning 0644 LOCAL TIME and reaches the destination Columbus at 0849 LOCAL TIME. In the same evening it leave Columbus at 1625 hrs LOCAL TIME and reaches the destination at 1638 LOCAL TIME. Find the time that the plane takes to travel either way? Ans: 69 mins nfosys Sample Paper Chennai with Answers and Solutions. 1. int i,*p=&i; p=malloc(10); free(p); printf("%d",p); ans : garbage 2. int i=20,*j=&i f(i)

printf("%d",i);

3. Working independently, Tina can do a certain job in 12 hours. Working independently, Ann can do the same job in 9 hours. If Tina works independently at the job for 8 hours and then Ann works independently, how many hours will it take Ann to complete the remainder of the jobs? (A)2/3 (B)3/4 (C)1 (D)2 (E)3 Ans :E)3

4. A decorator bought a bolt of d m number of red chips in any one stack ? (A)7 (B)6 (C)5 (D)4 (E)3 Answer :C) 5 5. If the list price of a book is reduced by Rs. 5, then a person can buy 5 more books for Rs. 300. The original cost of the book is (1) Rs. 15 (2) Rs. 20 (3) Rs. 25 (4) Rs. 30 6. A man has only 20-paise and 25-paise coins in a bag. If he has 50 coins in all totaling to Rs.11.25, then the number of 20-paise coins is (1) 28 (2) 27 1 (3)26 (4) 25 7. Working independently, Tina can do a certain job in 12 hours. Working independently, Ann can do the same job in 9 hours. If Tina works independently at the job for 8 hours and then Ann works independently, how many hours will it take Ann to complete the remainder of the jobs? (A)2/3 (B)3/4 (C)1 (D)2 (E)3 Ans :E)3 8. A decorator bought a bolt of d m number of red chips in any one stack ? (A)7 (B)6 (C)5 (D)4 (E)3 Answer :C) 5 9. A warehouse had a square floor with area 10,000 sq.meters. A rectangular addition was built along one entire side of the warehouse that increased the floor by one-half as much as the original floor. How many meters did the addition extend beyond the original buildings ? (A)10 (B)20 (C)50

(D)200 (E)500 Ans: c)50 10. A digital wristwatch was set accurately at 8.30 a.m and then lost 2 seconds every 5 minutes. What time was indicated on the watch at 6.30 p.m of the same day if the watch operated continuously that time ? (A)5:56 (B)5:58 (C)6.00 (D)6.23 (E)6.26 Ans :E) 6.26

Anda mungkin juga menyukai