Coding | Mcqs | Multiple choice questions | Informative | Computer Science | Engineering | Aptitude | Quants | Verbal

INFEED

Mock Test | 10 | Daily Test | sep 6

 Numerical Ability


1.

Sone lal has ’n’ magical eggs whose average weight is ’k’ gm.Each of the ’n’ eggs produces ’n’ eggs next

day such that the average weight of ’n’ eggs produced in same as that of the parental (previous

generation) egg for each ’n’ groups individually i.e., each egg produces ’n’ eggs in its next generation and

the average weight of all the ’n’ eggs of next generation is same as the weight of the mother egg.This

process is continued without any change in pattern.What is he total weight of all the eggs of rth

generation, where the initial number of eggs with Sone Lal are considered as the eggs of first generation:

n*k^2

n^2*k^2

n^2*k

n*k


2.

The price of tea is raised by 12.5%. By how much per cent must a man reduce his consumption of tea so

as not to increase his expenditure?

12%

15%

10%

11.11%




3.
How many numbers between 4000 and 6000 can be formed using the digits 1–6, when digit can occur
any number of times?
500
545
400
432


4.
Ramu is twice as good a workman as Raju and together they complete a work in 15 days. In how many
days can the work be completed by Raju alone?
45 days
60 days
30 days
90 day
.

5.
f a,b,c,d are positive real numbers such that a+b+c+d=2, then M=(a+b)(c+d) satisfies the relation is :
2≤M≤3
3≤M≤4
0<M≤1
1≤M≤2



6.
Hanuman can complete a bridge in 10 days and Ravanan can complete the same bridge in 20 days. Now
they are working together and they are completing the bridge in 20 days. What is the contribution of
Ravanan in constructing the bridge?
Delaying the construction.
None of these
Destructing the bridge.
Constructing the bridge..


7.
There is a tank and two pipes P and Q. P can fill the tank in 50 minutes and Q can empty the tank in 40
minutes. If both the pipes are opened at same time. How much time required for the tank to be filled?
30 min
Never be filled
1 hour
3 hours


8.
The workers in three shifts of a company are in the ratio of 2 : 3 : 4. If 64 workers are added in each shift,
the ratio becomes 4 : 5 : 6. Find the total number of workers in all the three shifts.
288
300
200
250


9.
What is the remainder when 3431^301 is divided by 9?
6
9
5
7


10.
If xy denotes x raised to the power y, find last two digits of (18513843) + (18614181)
15
17
13
12


11.
The minute hand of a clock is 6 cm and that of hour hand is 5 cm. If they run for 3 days, how much
distance is covered by both the hands?
934Ï€
904Ï€
924Ï€
914Ï€


12.

A number divided by 374 leaves 6 as remainder. If the number is divided by 17, what is the remainder?
7
9
5
6


13.
In how many ways can five prizes be distributed to 10 boys if each boy is eligible for getting more than
one prize?
8^5
None of these
10^5
9^5


14.
Akash, Pranav and Shardul can do a piece of work in 5 days. After working for 3 days, Pranav turns
hostile, destroys 28.57% of the work and leaves. Now, Akash and Shardul take 4 more days to finish the
work. If Shardul takes 14 days to finish the work alone, how many days will Akash take to finish the work
alone?
10 days
7 days
6 days
8 days


15.
Asha, Beena and Cersi takes 20, 30, 60 days respectively to complete a work. If each work one day
alternatively, on which day will they compete the work?
50 days
20 days
30 days
40 days


16.
If A = x7 y3 and B = x4y6, then find the HCF of A and B.
X^4*Y^3
None of these
X^2*Y
X^3*Y^3


17.
Consider an equilateral triangle of side length n, which is divided into unit triangles, as shown. Let f(n)
be the number of paths from the triangle in the top row to the middle triangle in the bottom row, such
that adjacent triangles in our path share a common edge and the path never travels up (from lower row
to a higher row) or revisits triangle. An example of one such path is illustrated below for n = 5.
Determine the value of f(2005)
(2003)!
(2004)!s
(2001)!


18.
A person starts writing all the 3 digit numbers, how many times has he written the digit 4?
300
350
200
280



19.

In a single throw with two dice, find the probability that their sum is a multiple either of 4 or 5.
4/7
3/7
4/9
2/9


20.
A sum of money under compound interest doubles itself in 4 years. In how many years will it become 64
times itself?
28 years
30 years
20 years
24 years



21.
A hog makes 18 leaps in the same time as a tiger makes 10. But the tiger’s leap is 2 m while hog’s is only 1
m. How many leaps will the tiger have to make before catching up with the hog if the hog has a head
start of 16 m?
45 leaps
50 leaps
40 leaps
80 leaps


22.
A alone can do 1/3rd of the work in 6 days. B alone can do 1/6th of the work in 4 days. If A and B along
with C work together, they can complete it in 6 days. So what part of the work will be completed by C in
3 days?
5/35
7/39
5/24
3/47



23.
The sum of the 4th and 6th terms of an arithmetical progression is 42. The sum of the 3rd and 9th
terms of the progression is 52. find the sum of the ten terms of the progression?
256
289
235
200


24.
There are 200 in a class and they attend a test. 20 students are failed in both the subjects. 100
students pass in subject A. 120 students passed in subject B. How many students passed in subject A
only.
60
75
50
45



25.
A certain sum of money is sufficient to pay either Bahubali wages for 30 days or Kattapa wages for 20
days .For how long will it be sufficient if both Bahubali and Kattapa work together ?
15 days
20 days
10 days
12 days



26.
Raj drives slowly along the perimeter of a rectangular park at 24 kmph and completes one full round in 4
minutes. If the ratio of the length to the breadth of the park is 3:2, what are its dimensions?
234 x 124
245 x 167
480 x 320
300 x 450

--------------------------------------------------------------------------------------------------------------------


Reasoning Ability



1.
A lion lies on Monday, Tuesday, and Wednesday. A rat lies on Thursday, Friday and Saturday. Both of
them speak the truth on other days. Lion says, “Yesterday was one of the days when I was lying”. Rat
also says, “Yesterday was one of the days when I was lying”. What day was yesterday?
Monday or Thursday
Sunday or Wednesday
Sunday
Wednesday


2..
Beckham is to the North of the Ansy Hurray. Cristiano is in the East of Beckham. Dhoni is to the left of
Ansy. In which direction is Dhoni with respect to Cristiano?
West
North-East
North
South-West
South


3.
Find the odd man out.
AZ, ZA, XC, UE, QJ, LO
QJ
UE
AZ
LO
ZA


4.
Choose from the following:
A. If (a) alone is sufficient to answer the question.
B. If (b) alone is sufficient to answer the question.
C. If (a) and (b) together are necessary to answer the question.
D. If either (a) or (b) is sufficient to answer the question.
E. If neither (a) nor (b) is sufficient to answer the question.
What is the number?
(a) The sum of two digits is 8. The ratio of the two digits is 1 : 3.
(b) The number is divisible by 13

E


5.
Directions: The length, breadth and height of a rectangular piece of plastic are 4 cm, 3 cm and 5 cm,
respectively. Opposite sides of 4 cm 3 cm are coloured in brown. Opposite sides of 5 cm 4 cm are
coloured in orange colour. 5 cm 3 cm are coloured in yellow colour in both the sides. Plastic piece is
cut in such way that a cuboid of 1 cm 1 cm * 1 cm will be made. How many cuboids shall have only two
colours, orange and yellow, on their two sides?
24
20
12
16
14



6...

It takes a pendulum of a clock 7 seconds to strike 4 o’clock. How much time (in seconds) will it take to
strike 11 o’clock?
18 seconds
None of the above
23.33 seconds
20 seconds



7.
If in a clock, the numbers 1 to 12 are replaced with alphabets starting from F (For instance F in place of 1,
G in place of 2 and so on), then which of the following options shall indicate the time as 9 o’clock?
P:M
N:Q
M:P
Q:N



8.
If SAUCER is coded as TBVBDQ, how is TOWN coded?
UPVM
UPYM
UPXO
UPOX
PUOX


9.
In a certain code language, ‘vee luk chic’ means ‘big and mighty’, ‘dil sic ko’ means ‘sing or dance’ and
‘sur luk fo’ means ‘tall and handsome’. Which of the following would mean ‘sing mighty’?
dilvee
Cannot be determined
sic chic
None of these
chic vee



10.
From the two statements given below, which of the following conclusions can be drawn?
Some trucks are four-wheelers.
All trucks are cars.
Some cars are four-wheelers
None of these
No cars are four-wheelers
All four-wheelers are cars


11.
Directions: In an IT department, 150 students like Infosys, 160 students TCS and 200 students like
Wipro. Forty students like Infosys and TCS but not Wipro. One hundred and forty students who like
Wipro also like exactly one of TCS and Infosys. There is at least one student who like any one of the
companies. If 50 students like only Wipro find the number of students who like only Infosys or TCS only.
50
60
80
40
70



12.
Instruction: Identify the error.
A student knows / how to prepare / for exam / and writing exam.
For exam
And writing exam
A students knows
How to prepare


13.
Choose from the following:
A. If (a) alone is sufficient to answer the question.
B. If (b) alone is sufficient to answer the question.
C. If (a) and (b) together are necessary to answer the question.
D. If either (a) or (b) is sufficient to answer the question.
E. If neither (a) nor (b) is sufficient to answer the question.
What was the gross income of VTR Associates for the year 2012?
Statements:
(a) In 2013, the gross income was Rs. 2100 crores.
(b) In 2012, the gross income was 10% greater than the previous year and 5% greater than the
subsequent year.
 
C


14.
From the two statements given below, which of the following conclusions can be drawn? All cats are
cute.
All dogs are cute.
All dogs are cats
None of these
Some dogs are cats
Some dogs are not cats


15.
Answer the questions on the basis of the information given below. In a country called XYZ, the number
of patients changes every year. The graph given below shows the percentage change in the number of
patients w.r.t. the previous year. The table given below shows the number of hospitals available in XYZ.
The number of patients in 1999 was 200000. The Unhealthiness Index of XYZ for a year is defined as
the number of patients per hospital in the country.
Find the Unhealthiness Index of XYZ in the year 2004
 
22.3


16.
87 : 20 :: 126 : ?
29
39
33
44



17.
Direction: Parth found a 9 cm red coloured cube on the street. The cube was divided into small cubes
of 1 cm each. Tarun found the cube with Parth and wanted to play with it. Parth asked Tarun to answer
the following questions about the cube first.
How many small cubes of 1 cm size will be there?
729
512
343
256
216


18.
Directions: Study the following graph carefully to answer the given questions:
What is the % increase in the income of company B from 2006 to 2008?
 
33.33%


19.
Find the missing term.
H, G, I, E, K, B, N, ?
Y
X
A
D
Z


20.
Find the odd man out.
23, 45, 68, 113, 179, 294
113
139
45
68
179


21.
When 5 5 5 cube is cut vertically along one of its diagonal, find the number of cubes that are not cut
into two.
27
100
50
80
25



22.

Answer the questions on the basis of the information given below. In a country called XYZ, the number
of patients changes every year. The graph given below shows the percentage change in the number of
patients w.r.t. the previous year. The table given below shows the number of hospitals available in XYZ.
The number of patients in 1999 was 200000. The Unhealthiness Index of XYZ for a year is defined as
the number of patients per hospital in the country.
By what percentage should the number of hospitals increase in 2002 to maintain the Unhealthiness
index as 30?
 
47%



23.
Five girls are sitting on a bench to be photographed. Sneha is to the right of Geetha and to the left of
Ganga. Mercy is to the left of Geetha. Ajitha is between Geetha and Mercy.
Who is sitting immediate left to Ajitha ?
Ganga
Mercy
Sneha
Geetha



24.
Answer the questions on the basis of the information given below. In a country called XYZ, the number
of patients changes every year. The graph given below shows the percentage change in the number of
patients w.r.t. the previous year. The table given below shows the number of hospitals available in XYZ.
The number of patients in 1999 was 200000. The Unhealthiness Index of XYZ for a year is defined as
the number of patients per hospital in the country.
If the scale marked in the Y axis of the line graph is inverted (i.e. -40 to 30 is changed to 40 to -30),
find the ratio of the number of patients in the year 2000 and 2003.

625:414



25.
Choose from the following:
A. If (a) alone is sufficient to answer the question.
B. If (b) alone is sufficient to answer the question.
C. If (a) and (b) together are necessary to answer the question.
D. If either (a) or (b) is sufficient to answer the question.
E. If neither (a) nor (b) is sufficient to answer the question.
Is xy < 0?
(a) 5|x| + |y| = 0
(b) |x| + 5|y| = 0
C
D
A



26.
Directions: The length, breadth and height of a rectangular piece of plastic are 4 cm, 3 cm and 5 cm,
respectively. Opposite sides of 4 cm 3 cm are coloured in brown. Opposite sides of 5 cm 4 cm are
coloured in orange colour. 5 cm 3 cm are coloured in yellow colour in both the sides. Plastic piece is
cut in such way that a cuboid of 1 cm 1 cm * 1 cm will be made. How many cuboids shall have only one
colour?
13
20
22
32
27


27.
Directions: Study the following graph carefully to answer the given questions:
The total income of all the three companies together was minimum in which of the following years?

2005


28.
Directions: Assume the given statements to be true, even if they seem to be at variance with
commonly known facts and mark your answer as A. If only conclusion i follows.
B. If only conclusion ii follows.
C. If both the conclusions follow.
D. If neither i nor ii follow.
E. If either i or ii follows.
Statements:
i. All pens are blue.
ii. Only pencils are blues.
Conclusions:
i. All pens are pencils.
ii. Some pens are not pencils
 
A
 


29.
Four friends Arjun, Bala, Chandru, and Deepak live in same locality. Bala’s house is in the East of Arjun’s
house but in the North of Chandru’s house. Chandru’s house is in the West of Deepak’s house. Deepak’s
house is in which direction of Arjun’s house?
East
South-West
South-East
Data inadequate
North-East


30.

Directions: In an IT department, 150 students like Infosys, 160 students TCS and 200 students like
Wipro. Forty students like Infosys and TCS but not Wipro. One hundred and forty students who like
Wipro also like exactly one of TCS and Infosys. There is at least one student who like any one of the
companies. If 10 students like all the three companies how many students like exactly one of the three
companies?
100
110
120
90
130

-------------------------------------------------------------------------------------


Verbal Ability



1.
Instruction: Rearrange the four sentences A, B, C, D, in the proper sequence so as to form a
meaningful paragraph.
1) His political career came to an abrupt end with China’s military operation.
2) He attracted as as repelled.
3) He was responsible for the debacle.
4) A man of paradoxes, Menon remained an enigma.
3142
4213
1234
2341


2.
Instruction: Fill in the blanks with the suitable phrasal verb.
I refused to ___ their decision to close the children’s club.
Go together
Went off
Go along with
Went through



3.
Instruction: Read the passage and the answer the question given below.
Trade unions or labour unions first appeared in Europe as a result of the industrial revolution. Workers
were at the mercy of the employer. They were underpaid, lacked any sort of training, and sometimes
mistreated. When trade unions emerged, they became powerful organisations. Workers got together
and organised themselves to make sure that employers do not exploit them anymore. Nowadays, the
main goal of trade unions is to negotiate labour contracts with employers. The leaders of trade unions
speak on behalf of workers and are predominantly worried about wages, working conditions and the
laws that govern the hiring, firing and promotion of workers. In some cases unions may call for strikes to
force employers to negotiate a deal or they may promote political legislation favourable to the interests
of their members or workers as a whole. To achieve this aim they may support and get closely linked to
particular political parties. Some people blame unions for creating tense atmosphere between
employers and employees. Others even accuse them of engendering relentless inflation. But the truth
is that the working conditions have changed tremendously since the industrial revolution. Unions have
contributed to considerably improve the standard of living. For instance, child labour is now prohibited
by law. What is more, unions have also been credited for introducing minimum wage limits and for
forbidding disreputable employers to exploit and mistreat their workers.
What is the author’s tone in the passage?

Optimistic


4.
Instruction: According to the sentence find out the synonym of the word given in bold.
Malar felt elated and decided to give her best.
very happy
very happy and excited
sorrow
happy



5.
Instruction: Read the passage and the answer the question given below.
Trade unions or labour unions first appeared in Europe as a result of the industrial revolution. Workers
were at the mercy of the employer. They were underpaid, lacked any sort of training, and sometimes
mistreated. When trade unions emerged, they became powerful organisations. Workers got together
and organised themselves to make sure that employers do not exploit them anymore. Nowadays, the
main goal of trade unions is to negotiate labour contracts with employers. The leaders of trade unions
speak on behalf of workers and are predominantly worried about wages, working conditions and the
laws that govern the hiring, firing and promotion of workers. In some cases unions may call for strikes to
force employers to negotiate a deal or they may promote political legislation favourable to the interests
of their members or workers as a whole. To achieve this aim they may support and get closely linked to
particular political parties. Some people blame unions for creating tense atmosphere between
employers and employees. Others even accuse them of engendering relentless inflation. But the truth
is that the working conditions have changed tremendously since the industrial revolution. Unions have
contributed to considerably improve the standard of living. For instance, child labour is now prohibited
by law. What is more, unions have also been credited for introducing minimum wage limits and for
forbidding disreputable employers to exploit and mistreat their workers.
What is the primary goal of a trade union?
 
 To negotiate labour ......


6.
Instruction: Fill in the blank with the most suitable option.
The little child was lost __ the crowd.
on
on
By
beside
in


7.
Instruction: According to the sentence find out the meaning of the word given in bold.
Michael is bored with his daily chores.
Lessons
Tasks
Plans
Obstacles



8.
Instruction: Rewrite the following sentence after changing the form of speech.
He said he worked for Tech Mahindra.
He said, “I work for Tech Mahindra”.
He said, “I had to work for Tech Mahindra”.
He said, “I worked for Tech Mahindra”.
He said, “I had worked for Tech Mahindra

9..
Instruction: Fill in the blanks with the suitable phrasal verb.
Pragati ___ win the competition if she works hard enough for it.
can
had
were
used to


10.
Choose the appropriate modal verb for given.
Shamali didn’t sleep well yesterday. So, she ____ sleep in office today.
had
must
Ought to
should



11.
Instruction: Read the passage and the answer the question given below.
Trade unions or labour unions first appeared in Europe as a result of the industrial revolution. Workers
were at the mercy of the employer. They were underpaid, lacked any sort of training, and sometimes
mistreated. When trade unions emerged, they became powerful organisations. Workers got together
and organised themselves to make sure that employers do not exploit them anymore. Nowadays, the
main goal of trade unions is to negotiate labour contracts with employers. The leaders of trade unions
speak on behalf of workers and are predominantly worried about wages, working conditions and the
laws that govern the hiring, firing and promotion of workers. In some cases unions may call for strikes to
force employers to negotiate a deal or they may promote political legislation favourable to the interests
of their members or workers as a whole. To achieve this aim they may support and get closely linked to
particular political parties. Some people blame unions for creating tense atmosphere between
employers and employees. Others even accuse them of engendering relentless inflation. But the truth
is that the working conditions have changed tremendously since the industrial revolution. Unions have
contributed to considerably improve the standard of living. For instance, child labour is now prohibited
by law. What is more, unions have also been credited for introducing minimum wage limits and for
forbidding disreputable employers to exploit and mistreat their workers.
How does the author feel about people accusing unions of engendering relentless inflation?
 
Diagree


12.
nstruction: Rearrange the five sentences A, B, C, D, and E in the proper sequence so as to form a
meaningful paragraph.
A. Many consider it wrong to blight youngsters by recruiting them into armed forces at a young age.
B. It is very difficult to have an agreement on an issue when emotions run high.
C. The debate has again come up whether it is right or wrong.
D. In many countries, military service is compulsory for all.
E. Some of the detractors of compulsory draft are even very happy.
CBADC
DCABE
ABDCE
EDCAB


13.
Instruction: According to the sentence find out the meaning of the word given phrasal verb.
The press has put out a statement condemning the recent protests.
cancel
organize
decline
issue


14.
Instruction: Rearrange the four sentences A, B, C, D, in the proper sequence so as to form a
meaningful paragraph
S1.Water is a renewable natural resource and public good.
A. However, most rivers, ponds, lakes and aquifers are common property.
B. Hence, excluding others from using water is not possible and the results are competition, over
extraction and conflict.
C. But the ownership right on land bestows a private character on water.
D. Therefore, water rights are not clearly defined and the right to using the resources is not protected.
S6. However, cooperation has a greater role in achieving social harmony in water allocation and
increasing human welfare
ACDB
BCAD
DACB
CADB 
 


15.
Instruction: Read the passage and the answer the question given below.
Trade unions or labour unions first appeared in Europe as a result of the industrial revolution. Workers
were at the mercy of the employer. They were underpaid, lacked any sort of training, and sometimes
mistreated. When trade unions emerged, they became powerful organisations. Workers got together
and organised themselves to make sure that employers do not exploit them anymore. Nowadays, the
main goal of trade unions is to negotiate labour contracts with employers. The leaders of trade unions
speak on behalf of workers and are predominantly worried about wages, working conditions and the
laws that govern the hiring, firing and promotion of workers. In some cases unions may call for strikes to
force employers to negotiate a deal or they may promote political legislation favourable to the interests
of their members or workers as a whole. To achieve this aim they may support and get closely linked to
particular political parties. Some people blame unions for creating tense atmosphere between
employers and employees. Others even accuse them of engendering relentless inflation. But the truth
is that the working conditions have changed tremendously since the industrial revolution. Unions have
contributed to considerably improve the standard of living. For instance, child labour is now prohibited
by law. What is more, unions have also been credited for introducing minimum wage limits and for
forbidding disreputable employers to exploit and mistreat their workers.
What is the antonym of the word ‘tremendously’?
 
Slightly



16.
Instruction: Identify the correct alternative for the given sentence.
A majority of the international journalists surveyed view nuclear power stations as unsafe at present
but that they will, or could, be made sufficiently safe in the future.
they will be or could
think that they will be or could
that they will, or could,
think the power stations would or could
that they would, or could


17.
Instruction: Rewrite the following sentence after changing the form of speech.
Stefen said he hoped to square the series by winning the next round.
Stefen said, “I will square the series and so, win the next round.”
Stefen said, “I will win the next round and so, will square the series”
Stefen said, “I hope to square the series by winning the next round.”
Stefen said, “I think I can square the series by winning the next round.”


18.
Instruction: According to the sentence find out the synonym of the word given in bold.
The King summoned his subjects for a mass prayer. Here ‘summoned’ means:
Gathered
called
Dictated
Ordered


19.
Instruction: According to the sentence find out the meaning of the word given in bold.
The man held out his battered hat for alms.
Woollen cloth
beautiful
New
Beaten up



20.
Instruction: Identify the error.
I was / so overcome with hunger / that either of the foods / were fine with me.
That either of the foods
Were fine with me
I was
So overcome with hunger



21.
Instruction: Fill in the blank with the most suitable option.
This is a conclusion that can be Q1 from a recent study based on interviews with the owner-managers
of 40 small businesses. The research makes the reason Q2 management behavior, however well
intentioned, is often theQ3 of the problem. This was the overwhelming viewQ4by the managers
surveyed: the main barrier to growth was the fact that day-to-day issuesQ5all their time.
Which options suits blank 1?
acquired
obtained
achieved
drawn



22.
Instruction: Fill in the blank with the most suitable option.
I saw the news __ the television.
on
at
off
in
of


23.
Instruction: Fill in the blank with the most suitable option.
This is a conclusion that can be 1 from a recent study based on interviews with the owner-managers
of 40 small businesses. The research makes the reason 2 management behavior, however well
intentioned, is often th 3 of the problem. This was the overwhelming vie 4by the managers surveyed:
the main barrier to growth was the fact that day-to-day issues 5_all their time.
Which option suits blank 2?
resolved
defined
Clear
distinct


24.
Instruction: Choose the right fit for the blank.
One of the strategies of the octopuses is to ____ ink into its surroundings to ward off predators.
Imbibe
Engulf
Swallow
Secrete
-----------------------------------------------------------------------------------------


Technical Mcq's



1.
What will be the output of the following Java code?
 class area {
 public static void main(String args[])
 {
 double r, pi, a;
 r = 9.8;
 pi = 3.14;
 a = pi * r * r;
 System.out.println(a);
 }
 }
301.56
301.56560000
301.5656


2.
What will be the output of the following Java code?
 class average {
 public static void main(String args[])
 {
 double num[] = {5.5, 10.1, 11, 12.8, 56.9, 2.5};
 double result;
 result = 0;
 for (int i = 0; i < 6; ++i)
 result = result + num[i];
 System.out.print(result/6);
 }
 }
16.46666666666667
16.46666666666666
16.34


3.
Which feature of OOP is indicated by the following code?
class student{ int marks; };
class topper:public student{ int age; topper(int age){ this.age=age; } };
Inheritance and polymorphism
Encapsulation and Inheritance
Inheritance
Polymorphism

4.
Which feature may be violated if we don’t use classes in a program?
Encapsulation only is violated
Basically all the features of OOP gets violated
Inheritance can’t be implemented
Object must be used is violated


5.
If different properties and functions of a real world entity is grouped or embedded into a single element,
what is it called in OOP language?
Abstraction
Encapsulation
Inheritance
Polymorphism


6.
If a function can perform more than 1 type of tasks, where the function name remains same, which
feature of OOP is used here?
Polymorphism
Abstraction
Encapsulation
Inheritance


7.
Which among the following doesn’t come under OOP concept?
Message passing
Data hiding
Platform independent
Data binding


8.
Which feature of OOP indicates code reusability?
Abstraction
Polymorphism
Encapsulation
Inheritance
 

9.
What will be the output of the following Java code?
 class increment {
 public static void main(String args[])
 {
 int g = 3;
 System.out.print(++g * 8);
 }
 }
32
33
25
24


10.
Which of the following is not a feature of pure OOP?
Data may/may not be declared using object
Functions Overloading
Classes must be used
Inheritance


-----------------------------------------------------------------------------------------

Programming


1.
Problem statement
Given an Integer N, write a program to reverse it.
Input Format
The first line contains an integer T, total number of testcases. Then follow T lines, each line contains an
integer N.
Constraints
1 ≤ T ≤ 1000
1 ≤ N ≤ 1000000
Output Format
For each test case, display the reverse of the given number N, in a new line.
Sample Input:
4
12345
31203
2123
2300
Sample Output:
54321
30213
3212


C CODE:

 

#include<stdio.h>



int main()



{ int t,i,d;



  long a;



  scanf("%d",&t);



  while(t--)



  {   long s=0;



   scanf("%ld",&a);



   while(a!=0){



    d=a%10;



    s=s*10+d;



    a=a/10;


    


   }


   


   printf("%ld\n",s);



  }



}




2.
Problem statement
Creatnx now wants to decorate his house by flower pots. He plans to buy exactly N ones. He can only
buy them from Triracle's shop. There are only two kind of flower pots available in that shop. The shop is
very strange. If you buy X flower pots of kind 1 then you must pay A x X^2 and B x Y^2? if you buy Y
flower pots of kind 2. Please help Creatnx buys exactly N flower pots that minimizes money he pays.
Input Format
The first line contains a integer T denoting the number of test cases.
Each of test case is described in a single line containing three space-separated integers N, A, B.
Constraints
•1<T < 10^5
•1<N, A, B < 10^5
Output Format
For each test case, print a single line containing the answer.
Sample Input;
2
5 1 2
10 2 4
Sample Output:
17
134
 
 

c++ code:  

 #include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main()
{
    ll t; cin>>t; while(t--)
    {
        ll n,a,b;
        cin>>n>>a>>b;
        ll k=(b*n)/(a+b);
        ll x=(a*k*k) + (b*(n-k)*(n-k));
        k++;
        ll y=(a*k*k) + (b*(n-k)*(n-k));
        cout<<min(x,y)<<endl;
    }
}


--------------------------------------------------------------------------------------




































Post a Comment

Previous Post Next Post