Вы находитесь на странице: 1из 24

Cts

1) In an election between two candidates, one got 55% of the total valid votes
and got 20% invalid votes. At the end of the day when the total number of
votes were counted, the total number was found to be 7500. So what was the
total number of valid votes that the winning candidate got, was:
a) 2400
b) 3100
c) 3400
d) 2700

Answer: d
Explanation
Since 20% of the votes were invalid, 80% of the votes were valid = 80% of 7500 =
6000 votes were valid. One candidate got 55% of the total valid votes, then the
second candidate must have 45% of the votes = 0.45 * 6000 = 2700 votes.

2) A whole number n which when divided by 4 gives 3 as remainder. What will


be the remainder when 2n is divided by 4?
a) 0
b) 1
c) 4
d) 2

Answer: d
Explanation
According to the question, n = 4q + 3. Therefore, 2n = 8q + 6 or 2n = 4(2q + 1) + 2.
Thus, we get when 2n is divided by 4, the remainder is 2.

3) Raju, Ramu and Razi can do a piece of work in 20, 30 and 60 days
respectively depending on their capacity of doing work. If Raju is assisted by
Ramu and Razi on every third day, then in how Raju will complete the work?
a) 12 days
b) 15 days
c) 16 days
d) 18 days

Answer: b
Explanation
We need t first count the amount of work done in 2 days by Raju.
Raju can do a piece of work in 20 days. So, in 2 days he can do = 1/20 * 2 = 1/10.
Amount of work done by Raju, Ramu and Razi in 1 day = 1/20 + 1/30 + 1/60 = 1/10.
Amount of work done in 3 days = 1/10 + 1/10 = 1/5.
So the work will be completed in 3 * 5 = 15 days.

4) What is the smallest number which when decreased by 8 is divisible by 21,


27, 33, and 55?
a) 1490
b) 10405
c) 15490
d) None of the above

Answer: d
Explanation
We need to find the LCM of the given numbers, LCM of 21, 27, 33, and 55 = 10395.
So we need to add an extra 5 = 10403.

5) A tap can fill a bucket in 6 hours. After half the bucket is filled, three more
similar taps are opened. What is the total time taken to fill the bucket
completely?
a) 3 hrs 15 min
b) 3 hrs 45 min
c) 4 hrs 25 min
d) 4 hrs 15 min

Answer: b
Explanation
Time is taken by one tap to fill half the bucket = 3 hours. So the part filled 4 taps in
one hour = 4 * (1/6) = 2/3 of the bucket. Therefore, the remaining part is = (1 – 1/2)
= 1/2
Proportionally à 2/3: 1/2:: 1: x
=> x = 3/4 hours = 45 minutes. So the total time = 3 hrs 45 minutes.

6) A reduction of 20% in the price of strawberries enables a person to purchase


12 more for Rs. 15. What was the price of 16 strawberries before reduction
of price?
a) 6
b) 5
c) 7
d) 9

Answer: b
Explanation
Price x Consumption = Expenditure
(15 / 8x) – (15 / x) = 12
x = (15 x 2) / (12 x 8)
For 16 Strawberries = [(15 x 2) / (12 x 8)] x 16 = 5

7) The ratio of the no. of white balls in a bag to that of black balls is 1:2. If 9
grey balls are added the ratio of nos. of white, black and grey become 2:4:3.
How many black balls were in the bag?
a) 6
b) 9
c) 12
d) 8

Answer: c
Explanation
Consider x black balls were there. After adding 9 grey balls the ratio is 4/3. That
means, x/9 = 4/3. On solving we will get x = 12.

8) A sum of Rs.312 was divided among 100 boys and girls in such a way that the
boy gets Rs.3.60 and each girl Rs.2.40 the number of girls is:
a) 40
b) 45
c) 35
d) 30

Answer: a
Explanation
Let the number of girls =x, then boys will be (100−x)
3.60∗(100−x)+2.40x=312. On solving above eq. u will get, x=40.

9) The average weight of 8 person’s increases by 2.5 kg when a new person


comes in place of one of them weighing 65 kg. What might be the weight of
the new person?
a) 76 kg
b) 5 kg
c) 85 kg
d) None

Answer: c
Explanation
Total weight increased = (8 x 2.5) kg = 20 kg.
Weight of new person = (65 + 20) kg = 85 kg.
10) A shopkeeper gives two successive discounts of 20 % and 10 %
on surplus stock. Further, he also gives 5 % extra discount on cash payment. If a
person buys a shirt from the surplus stock and pays in cash, what overall
discount percent will he get on the shirt?
a) 60%
b) 5%
c) 33%
d) 2%

Answer: a
Explanation
Let the marked price of the shirt be Rs. 1000
=> Price after first discount = Rs. 1000 – 20 % of Rs. 1000 = Rs. 1000 – 200 = Rs. 800
=> Price after second discount = Rs. 800 – 10 % of Rs. 800 = Rs. 800 – 80 = Rs. 720
=> Price after cash discount = Rs. 720 – 5 % of Rs. 720 = Rs. 720 – 36 = Rs. 684
Therefore, total discount = Rs. 1000 – 684 = Rs. 316
=> Overall discount percent = (316 / 1000) x 100 = 31.60 %

Cognizant Aptitude questions – set 2

11) A & B are at a distance of 800 m. They start towards each other at 20 &
24 kmph. As they start, a bird sitting on the cap of A, starts flying towards B,
touches B & then returns towards A & so on, till they meet. What is the
distance traveled by the bird, if its speed is 176 kmph?
a) 3040 m
b) 3200 m
c) 3100 m
d) 2600 m

Answer: b
Explanation
The bird flies for the same time as both A and B take to meet. Since the time taken
by A and B together and the bird is same, so the distance covered will be in the ratio
of their speeds.
The ratio of the speeds is 44: 176 or 1: 4.
Hence, if A and B cover 800 m, the bird will cover 800*4 = 3200 m.

12) How long will a boy take to run round a square field of side 35 meters, If he
runs at the rate of 9 km/hr?
a) 40 sec
b) 50 sec
c) 56 sec
d) 54 sec

Answer: c
Explanation
Speed = 9 km/hr = 9 x (5/18) m/sec = 5/2 m/sec
Distance = (35 x 4) m = 140 m.
Time taken = 140 x (2/5) sec= 56 sec

13) A box contains 15 marbles out of which 4 are white, 5 are red and 6 are
blue. Three balls are to be drawn at random from the bag. What is the
probability that all of them are red is:

a) 1/22
b) 2/89
c) 2/77
d) 2/91

Answer: d
Explanation
The number of ways in which all the three balls would be red = 5C3 / 15C3 = 10/455
= 2/91.

14) From a group of 7 men and 6 women, five persons are to be selected to
form a committee so that at least 3 men are there in the committee. In how
many ways can it be done?
a) 624
b) 209
c) 756
d) 212

Answer: c
Explanation
From a group of 7 men and 6 women, five persons are to be selected with at least 3
men. Hence we have the following 3 options.
We can select 5 men à Number of ways to do this = 7C5
ii) We can select 4 men and 1 woman à Number of ways to do this = 7C4 × 6C1
iii) We can select 3 men and 2 women à Number of ways to do this = 7C3 × 6C2
Total number of ways = 7C5 + (7C4 × 6C1) + (7C3 × 6C2)
= 7C2 + (7C3 × 6C1) + (7C3 × 6C2) —- Expand this using nCr = nC (n – r)
= 21 + 210 + 525 = 756
15) How many 3-letter words with or without meaning, can be formed out of
the letters of the word, ‘LOGARITHMS’, if repetition of letters is not allowed?
a) 720
b) 420
c) 5040
d) 256

Answer: a
Explanation
The word ‘LOGARITHMS’ has 10 different letters. Hence, the number of 3-letter
words(with or without meaning) formed by using these letters.
i.e. 10P3 = 10 × 9 × 8 = 720

16) A problem is given to three students whose chances of solving it are 1/2,
1/3 and 1/4 respectively. What is the probability that the problem will be
solved?
a) 1/4
b) 1/2
c) 3/4
d) 7/12

Answer: c
Explanation
None solves the problem = 1/2 × 2/3 × 3/ 4 = 1/4
Hence, the problem will be solved = 1 – P (none solves the problem) = 1−1/4 = 3/4

17) Simplify: log43 × log24364


a) 3/5
b) 2/5
c) 3/4
d) 1/3

Answer: a
Explanation
Change of base formula: logax = logbx/ logba = log x / log a. Apply the given
formula and we get the answer as 3/5.

18) What is the number of digits in (33)3? Given that log3 = 0.47712.
a) 12
b) 13
c) 14
d) 15

Answer: b
Explanation
log (x) = 33 log(3)
= 27 x 0.47712 = 12.88224
Since the characteristic in the resultant value of log x is 12, Therefore the number of
digits in x is (12 + 1) = 13.

19) A hollow iron pipe is 21 cm long and its external diameter is 8 cm. If the
thickness of the pipe is 1 cm and iron weighs 8 g/cm3, then the weight of the
pipe is:
a) 6 kg
b) 696 kg
c) 36 kg
d) 9 kg

Answer: b
Explanation
Given the external diameter = 8 cm. Therefore, the radius = 4 cm.
The thickness = 1 cm. Therefore the internal radius = 4 – 1 = 3 cm
The volume of the iron = pi *(R^2 – r^2)*length = 22/7 *[(4^2) – (3^2)] *21 = 462
cm3.
Therefore, the weight of iron = 462 * 8 gm = 3.696 kg

20) Three cubes of edges 6 cm, 8 cm and 10 cm are meted without loss of metal
into a single cube. The edge of the new cube will be:
a) 16 cm
b) 14 cm
c) 12 cm
d) 8 cm

Answer: c
Explanation
Since the cube is melted so the volume of the new cube must be the same.
Volume of new cube = Volume of cube 1 + cube 2 + cube 3 = 63 + 83 + 103 = 216
+ 512 + 1000
a^3 = 1728, a = (1728)^(1/3) = 12
CTS Logical questions – set 1

Syllogism: Choose the conclusions which logically follow from the given
statements.

1) Statements: Some envelops are gums. Some gums are seals. Some seals are
adhesives.
Conclusions:
1) Some envelopes are seals.
2) Some gums are adhesives.
3) Some adhesives are seals.
4) Some adhesives are gums.
A) Only (3)
B) Only (1)
C) Only (2)
D) Only (4)

Answer: A

2) Statements: All men are vertebrates. Some mammals are vertebrates.


Conclusions:
1) All men are mammals.
2) All mammals are men.
3) Some vertebrates are mammals.
4) All vertebrates are men.
A) Only (4)
B) Only (2)
C) Only (3)
D) Only (1)

Answer: C

3) Statements: Some cars are jeeps. All the boxes are jeeps. All the pens are
cars.
Conclusions:
1) Some cars are boxes.
2) No pen is jeep.
3) Some boxes are cars.
4) None of three
A) Only (1) and (2)
B) Only (1) and (3)
C) Only (2) and (3)
D) Only (4)

Answer: A

4) Statements: All the bottles are boxes. All the boxes are bags. Some bags are
trays.
Conclusions:
1) Some bottles are trays.
2) Some trays are boxes.
3) All the bottles are bags.
4) Some trays are bags.
A) Only (3) and (4)
B) Only (1) and (2)
C) Only (2) and (3)
D) Only (1) and (4)

Answer: A

5) Ankit is the son of Zubin. Manju is the daughter of Anil. Sheela is the mother
of Manju. Mohan is the brother of Manju. How is Mohan related to Sheela?
A) Brother
B) Father
C) Son
D) Cannot be determined

Answer: C
Explanation
Manju is the daughter of Anil. Sheela is the mother of Manju. Therefore, Mohan is
the son of Sheela.

6) Pointing to a gentleman, Neeraj said,” His only brother is the father of my


daughter`s father.” How is the gentleman related to Neeraj?
A) Father
B) Grandfather
C) Brother-in-law
D) Uncle

Answer: D
Explanation: Father of Neeraj’s daughter’s father — Neeraj’s father.
7) Sonu`s mother is the only daughter of Riya`s father. How is Riya`s husband
related to Sonu?
A) Uncle
B) Father
C) Grandfather
D) Brother

Answer: B
Explanation
Clearly, the only daughter of Riya’s father is Riya herself. So, Sonu’s mother is Riya.
Thus, Riya’s husband is the father of Sonu.

8) Which of the following words would correctly decode the word ZHOFRPH if
the simple alphabet shifting code is used?
A) ARTISTS
B) COMPUTE
C) MAILING
D) MAILING

Answer: D

9) One evening, Shagi started to walk toward the Sun. After walking a while,
she turned to her right and again to her right. After walking a while, she again
turned right. In which direction is she facing?
A) South
B) East
C) West
D) North

Answer: A

10) Mala and Ram start from a fixed point. Mala moves 3 km north and turns
right and then covers 4 km. Ram moves 5 km west and turns left and walks 3
km. Now how far are they apart?
A) 10 km
B) 9 km
C) 8 km
D) 6 km

Answer: B
Cognizant Logical Reasoning – set 2

11) If ‘×’ means ‘addition’ ‘-‘ means ‘division, ‘÷’ means ‘subtraction’ and ‘+’
means ‘multiplication’, then which of the following equations is correct?
A) 16 + 5 – 10 × 4 ÷ 3 = 9
B) 16 – 5 × 10 ÷ 4 + 3 = 12
C) 16 + 5 ÷ 10 × 4 – 3 = 9
D) 16 × 5 ÷ 10 ÷ 4 – 3= 19

Answer: A

In the questions below there consists of a question and two statements numbered I
and II given below it. You have to decide whether the data provided in the
statements are sufficient to answer the question. Read both the statements and give
the answer

12) Question: What will be the total weight of 10 poles, each of the same
weight?
Statements:
I. One-fourth of the weight of each pole is 5 kg.
II. The total weight of three poles is 20 kilograms more than the total weight of two
poles.
A) I alone is sufficient while II alone is not sufficient
B) II alone is sufficient while I alone is not sufficient
C) Either I or II is sufficient
D) Neither I nor II is sufficient
E) Both I and II are sufficient

Answer: C

13) What is the value of x?


I. The square of x is 36
II. x(x-6) = 0
A) I alone is sufficient while II alone is not sufficient
B) II alone is sufficient while I alone is not sufficient
C) Either I or II is sufficient
D) Neither I nor II is sufficient
E) Both I and II are sufficient

Answer: C

14) A, B, C, D and E are sitting on a bench. A is sitting next to B, C is sitting next


to D, D is not sitting with E who is on the left end of the bench. C is on the
second position from the right. A is to the right of B and E. A and C are sitting
together. In which position A is sitting?
A) Between B and D
B) Between B and C
C) Between E and D
D) Between C and E

Answer: B

15) 4, 9, 256, 529, 573 which of these does not belong to the group.
A) 256
B) 573
C) 529
D) 9

Answer: B

16) 275, 132, 462, 396, 327, 891, 121 – Find the odd one out.
A) 327
B) 275
C) 121
D) 396

Answer: 327
Explanation: In each number except 327, the middle digit is the sum of the other
two.

Directions for Questions 17 to 20:


Read the following information carefully and answer these questions:
K, L, M, N, O, P and Q are sitting in a circle facing at the centre and playing cards.
O is neighbor of K and N.
Q is not between P and M.
P is to the immediate right of K.
L is second to the left of Q.

17) Which of the following does not have the pair of persons sitting adjacent to
each other?
A) ALK
B) ML
C) NO
D) QN
Answer: A

18) Which of the following pairs has the second person sitting immediately to
the right of the first?
A) KL
B) ML
C) OK
D) None of these
Answer: C

19) What is the position of P?


A) Second to the left of M
B) Second to the right of M
C) To the immediate left of K
D) To the immediate right of L
Answer: A

20) Who are the neighbors of L?


A) K and P
B) M and N
C) P and M
D) None of these
Answer: C

Cognizant Verbal questions – set 1

Directions for Questions 1 – 4:


Read the following passage carefully and answer the question.
Until a hundred years ago as humans we had a simple, uncomplicated biological
connect. It was a straightforward equation: we drew roughly 3,000 calories each of
energy out of the Earth for our food and life’s sustenance. Today that number per
capita has grown to 1,00,000 calories. We still need only 3,000 calories each to
nourish life itself. All the rest of this energy is what we extract from the Earth for
everything else besides keeping ourselves alive. In some countries, like the US; this
per capita number runs at over 2,00,000 calories! Some of us are concerned about
this. We fret over what we could and should really be doing to soften this abuse of
resources. Little things fox us in the welter of things that we get to read. What is
sustainable development? How can it be started at our homes? Beyond the
ceremonial planting of green arid getting people to run marathons of various lengths
in support of the environment, is there- more that we can add to the abstract value
of “sustainability”? What are the little things we can do in our day-to-day lives, to
reduce demand for things that people make and market? Of course, we know that it
helps to avoid a plastic bag when you can use a newspaper bag, or a brown bag, or
even a jute bag which you can use for many more years unlike a plastic bag which
you throw away in less than a week or after a few uses. However, there’s actually
quite a bit more that you and I can do without compromise on comfort, with very
little as cost incurred, with financial savings that you can gain on energy and water
use, and with solutions that are very feasible and within your reach. It is possible to
understand our ecological footprint and its disastrous consequences, not merely in
terms of our own behaviour as consumers, but really in terms of the impact on the
environment we make.

1) Why does the author ask his audience to use a jute bag?
A) Jute bags look more trendy and stylish.
B) It is the need of the hour, to save energy, to save our ecosystem.
C) Using jute bags helps in consuming only 3,000 calories from the Earth.
D) They are more easily available.

Answer: B
The passage states that we need to do more than just run marathons to increase
support from people. We need to find out little things in our day-to-day lives where
we can reduce energy consumption and using a jute bag will help reduce use of
plastic. The passage does not state how many calories can be saved if one uses a jute
bag.

2) What is the primary concern of the passage?


A) There is a need to save energy, especially for our future.
B) All of us should not only plant trees but also run the marathon.
C) Use of plastic bags should be completely banned.
D) We need to respect the Earth and consume less of its calories.

Answer: D
Explanation
The passage states that we are abusing Earth’s resources and talks about ways in
which we can reduce the demand for energy. The primary focus is on saving energy
now (at present). Hence we rule out option A.

3) A suitable title to the passage could be:


A) Lets Shift to Jute!
B) How to Consume Few Calories?
C) Save Energy, Save the Earth!
D) The Earth Heading for a Disaster.
Answer: C
Explanation
The focus is on saving energy and stopping the abuse of Earth’s resources.

4) Which one of the following statements cannot be inferred from the


passage?
A) There are many little things we can do to save our Earth.
B) Only running marathons of various lengths do not help.
C) We do not depend on the Earth for our food and life sustenance.
D) A lot many years before, our association with the Nature was quite simple.

Answer: C
Explanation
Refer to “We drew roughly 3,000 calories each of energy out of the Earth for our
food and life’s sustenance.” Option C contradicts this sentence. All the others are
inferred from the passage.

5) Thieves steal Hondas and Toyotas from the 1990s more than other models
because they can chop them up and sell them for parts that are worth more
than the car.
A) more than other models because they can chop them up and sell them for parts
that are worth more than the car
B) more than they steal other models because they can chop them up and sell them
for parts that are worth more than the car
C) more than they do other models because they can dismantle the cars and sell the
parts that are worth more than the car
D) more than other models because they can chop the cars up and sell them for
parts that are worth more than the car

Answer: C

6) If the books have been cataloged last week, why haven’t they been placed on
the shelf?
A) have been cataloged
B) would have been cataloged
C) was cataloged
D) were cataloged

Answer: D
7) Find out which part of the sentence contains an error.
A) Psychologists point out that B) there are human processes C) which does not
involve D) the use of words

Answer: C

8) Choose the best antonym for ‘Exodus’


A) Influx
B) Homecoming
C) Return
D) Restoration

Answer: A

9) Choose the best antonym for ‘Amused’


A) Jolted
B) Frightened
C) Saddened
D) Astonished

Answer: C

10) Choose the best antonym for ‘perfidious’


A) Treacherous
B) Loyal
C) Humane
D) Religious

Answer: B

Read the following passage carefully and answer the questions given below it.
Over the past few decades, many Asian nations transformed from poverty into global
competitors. From 2003 to 2007, Asian economies expanded at an average annual
rate of 8.1%, triple that of advanced economies. Over the same period, inflation in
Asia averaged only about 3.5%. But Asia could be facing turbulent economic times. In
May, the average inflation rate throughout the region reached nearly 7%, led by
spikes in oil and food prices. In India, inflation jumped to an 11.6% annual rate in
June, according to the latest government figures, the highest in 13 years.
Policymakers and central bankers are forced to raise interest rates and limit credit to
get inflation under control. But these same measures suppress the investment and
consumption that generates growth. The combination of slowing growth and soaring
inflation makes economic policy-making tricky. Inflation stirs up the middle classes
because it can quickly erase years of hardwon personal gains. Inflation is cruel to
the poor, because families have to spend a larger share of their meagre incomes on
necessities. In the Philippines, farmers, unable to afford fuel for tractors, use water
buffaloes to plough their fields.
But to avoid unrest, leaders cannot blindly adopt rigid anti-inflation measures. Voters
won’t hesitate to remove from office any politician who doesn’t deliver the goods. So
they cannot overreact to the inflation threat and scale down economic growth in the
process. Developing nations need to grow quickly to create jobs and increase
incomes for their large populations. With prices soaring, doing nothing is not an
option. Most central banks in Asia have started raising interest rates. The Reserve
Bank of India increased its benchmark rate twice last month to a six year high of
8.5%.
The challenge is especially difficult because currently, inflation is not of domestic
origin. Prices are being driven higher by a global surge in oil and food prices, which
individual governments can do little to control. Of course, inflation is not just a
problem in Asia. World Bank President Robert Zoellick called rising food and oil
prices a man-made ‘catastrophe’ that could quickly reverse the gains made in
overcoming poverty over the past seven years. For now, though, there is more talk
than action on the international front, so Asian governments are on their own. Even
though inflation throughout the region is likely to continue to rise in coming months,
no one is expecting an economic calamity. According to the Asian Development Bank
Asian countries have large hard currency reserves and relatively healthy banks, and
so are far better prepared to absorb external shocks than they were during the
region’s last recession ten years ago. Asian policymakers have learned their lessons
and are more alert.

11) Which of the following can be said about Asian economies during the
period from 2003- 2007?
1) Though inflation was rising at the time politicians did not pay much attention.
2) Many of the poor countries were able to compete internationally.
3) The growth rate of Asian countries was facilitated by growth in advanced
countries.
A) All 1, 2, and 3
B) Only 1
C) Only 2
D) Both 1 and 2
E) None of these

Answer: E

12) Which of the following is not an anti-inflation measure being used by Asian
countries?
1) Increase in benchmark interest rate by a central bank.
2) Checks on lending.
3) Subsidising fuel for farmers.
(A) Only 3
(B) Both 1 and 2
(C) Both 2 and 3
(D) Only 2
(E) None of these

Answer: C

13) What makes it difficult for Asian countries to control inflation?


A) Restrictions by organizations like the Asian Development Bank
B) Governments are indecisive and adopt counterproductive measures
C) The problem is global in nature, not restricted to their individual countries
D) Countries have never faced a financial crisis
E) Economic growth rate cannot occur in the absence of inflation

Answer: C

14) Why are experts not very concerned about the impact of inflation on Asian
economies?
1) Asian countries have not maintained substantial hard currency reserves.
2) The condition of Asian banks is currently both stable and strong.
3) The Asian Development Bank will bail them out of any trouble.
A) Only 1
B) Both 1 and 3
C) Both 1 and 2
D) Only 2
E) None of these

Answer: D

15) What is the author’s advice to politicians regarding the handling of


inflation?
A) They should focus on preventing agitations among their citizens not
implementing anti-inflation measures
B) They ought to implement anti-inflation measures even at the cost of losing office
C) They must focus on maintaining high economic growth rate as inflation will taper
off on its own
D) Countries should handle the problem independently and not collectively
E) None of these

Answer: C

16) Rearrange the sentences into a meaningful paragraph.


A) The modus operandi — anonymous people deposited and swiftly transferred
crores of rupees in the society’s accounts in the names of slum dwellers — reflects
poor regulatory oversight.
B) Multi-state cooperative credit societies, which accept deposits only from, and give
loans to, members, are regulated by the central registrar under the agriculture
ministry.
C) A report in ET by Sugata Ghosh shows how income-tax sleuths have unearthed a
case of large-scale money laundering through a multi-state urban cooperative credit
society’s account
D) The civil servant in charge, typically a joint secretary-level officer, is ill-equipped
and does not have the wherewithal to handle supervision.
a) ABCD
b) DCBA
c) CADB
d) CABD

Answer: d

17) Philosophical problems arise when people and questions that, though
very_______, have certain characteristics in common.
A) relevant
B) elementary
C) abstract
D) diverse

Answer: D

18) Although the substance is normally quite______________, scientists found that


when tempered with other elements it could be stored safely in metal
containers.
A) voluminous
B) caustic
C) insoluble
D) vapid
Answer: B

19) Choose the word which best expresses the meaning of the given word:
CORPULENT
A) Lean
B) Gaunt
C) Emaciated
D) Obese

Answer: D

20) REPERCUSSION (choose the word that expresses similar meaning)


A) Clever reply
B) Recollection
C) Remuneration
D) Reaction

Answer: D

) Check for syntax error/ logical error and correct the error to get the desired
output.
Given n, print from n to 0
int main()
{
int n;
scanf(“%d”, &n);
unsigned int i = n;
while(i >= 0)
{
printf(“%d\n”, i);
i–;
}
return 0;
}

Input: 4
Output: Infinite loop

Answer: Error – Logical error


unsigned int i = n; unsigned integer ranges from 0 to 65535, which will be taken in
the cyclic order. So i– will keep repeating in a cyclic way. The loop will never be
terminated. So it should be written as int i = n;

2) Find the factorial of a given number.


int main()
{
long int fact = 1, n, i;
scanf(“%d”, &n);

for(i =1; i <= n; i++)


{
fact = fact * i;
}
printf(“%d”, fact);
return 0;
}

Input: 20
Output: -2102132736

Answer: Error – Logical error


The fact and n are declared as long int, so in scanf and printf %ld should be used in
place of %d.

3) Check whether the below program print the below pattern


1111
222
33

void main()
{
int i, j, n;
scanf(“%d”, &n);
for(i = 1; i<n; i++)
{
for(j = 1; j<n; j++)
{
printf(“%d”, i);
}
printf(“\n”);
}
}

Input: 3
Output:
111
222
333

Answer: Error: Logical error


The inner for loop has to be written in this way: for(j = i-1; j<n; j++)

4) Find the greatest of three numbers.


int main()
{
int num1, num2, num3;
scanf(“%d %d %d”, &num1,&num2,&num3);
if (num1 > num2) && (num1 > num3)
{
printf(“%d”, num1);
}
elseif(num2>num3)
{
printf(“%d”, num2)
}
else
{
printf(“%d”, num3);
}
return 0;
}

Answer: Error: Syntax error


if (num1 > num2) && (num1 > num3) à it has to be written as if ((num1 > num2) &&
(num1 > num3)) and this line elseif(num2>num3) should be rewritten as else
if(num2>num3)

5) Fix the error, recompile and match against the output provided.
int main(void)
{
printf(“This is a \”buggy” program\n”);
return 0;
}

Corrected program:
int main(void)
{
printf(“This is a \”buggy\” program\n”);
return 0;
}

6) Code reuse: Convert Binary to Decimal by using the existing function.


void binarytodecimal(number)
{
// Type your code here
}
void main()
{
int num;
scanf(“%d”, &num);
printf(“%d”, binarytodecimal(num);
}

Answer:
void binarytodecimal(number)
{
int dval=0, base=1, rem;
while(number > 0)
{
rem = number % 10;
dval = dval + rem * base;
num = number / 10;
base = base * 2;
}
return dval;
}

7) Print the prime numbers from an array up to given value n by using existing
function.
int isprime(int num)
{
// type your code here
}
int main()
{
int n, m, arr[100], size=0, i;
scanf(“%d”, &n);
for(m = 2; m <= n; m++)
{
if(isprime(m))
{
arr[size++]= m;
}
}
for(i = 0; i < size; i++)
{
printf(“%d\n”, arr[i]);
}
return 0;
}

Answer:
int isprime(int num)
{
int i;
int isprime = 1;
for(i = 2; i <= num / 2; i++)
{
if(num % i == 0)
{
isprime = 0;
break;
}
}
return isprime;
}

Вам также может понравиться