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

INFEED

21 - August - nonprp daily test

 ** NON PRP DAILY TEST **


Quantitative Ability


1.

What is unit digit of the following sum : 1+2^2+3^3+4^4+5^5+6^6?
0
4
7
9
 

 

2.

DIRECTIONS : P $ Q means P is not smaller than Q P @ Q means P is neither smaller than nor equal to Q
P # Q means P is neither greater than nor equal to Q P & Q means P is neither greater than nor smaller
than Q P * Q means P is not greater than Q Statements: A $M, P @ L, K # P, A $ L Conclusions :I. K # L II.
A @ P III. L * A IV. M # P
If only conclusion I is true
If only conclusion III is true
If only conclusion II true
If only conclusion IV true
None follows
 

 

3.

The permutations and combinations of abcd taken 3 at a time are respectively:
12,2
24, 4
36, 6
48, 8
 

 

4.

Find the remainder when 2^11 is divided by 5.
0
1
2
3

 

5.

Choose the correct answer The number 456*85 is completely divisible by 3. Smallest whole digit
number in place of * can be:
0
1
2
3

 

6.

The LCM and HCF of two numbers are 2970 and 30 respectively. Prime factors of the product of two
numbers are
2,3,5,11
2,3,7,11
2,4,5,11
2,3,7,13

 

7.

The probability of getting atleast one tail in 5 throws of a coin is ?
1/32
31/32
1/5
None of these
 

 

8.

What is the probability of making an odd number of 4 digits using 5,7,9 and 4 without any digit being
repeated?
3/4
1/3
2/3
1/4

 

9.

EHKN:FGLM:: CFIL:
DEJK
DGJM
BEHK
BGJM
 

 

10.

Given Signs signify something and on that basis, assume the given statement to be true. Answer the
question basis the information provided. ">"denotes "greater than" "%" denotes "equal to" "@" denotes
"not less than" "=" denotes "not equal to " "*" denotes "less than" " # " denotes "not greater than " If
P%Q#R, it follows that
P=Q>R
P#Q>R
R%Q%P
P*R=Q
 

 

11.

Find the smallest three digit number that divides 229 and 568 leaving remainder 3 in each case
111
113
117
119
 

 

12.

A shopkeeper offers Buy 1, Get 1 Free offer on a t-shirt marked at Rs. 2,400. If after a sale, the
shopkeeper earns a profit of 33.33%, then what is the actual price of the t-shirt ?
Rs. 900
Rs. 800
Rs. 1,200
Rs. 1,000
Rs. 1,500
 

 

13.

If 4^(x+3)=2(^x+7), then the value of x is:
3
2
1
None of the above

 

14.

Choose the correct answer Simplify (144)(-3/2)*(-1/6)
2 sqrt(3)
6
3 sqrt(2)
4
 

 

15.

Which among the following is least?
0.2
1/0.2
0.22222222
(0.2)^2

 

16.

For the post of 3 engineers, there are 8 equally qualified candidates. In how many ways can they be
selected?
132
56
12
24

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

 Logical Reasoning


1.

Passage: The following are the conditions for selecting a Management trainee for a reputed company.
The candidate must
1.Be a graduate in the department of technology with atleast 50%.
2.Must be less than 35 years as on 1.12.2017.
3.Have uency in English and Hindi.
4.Should be able to pay 10000 as deposit.
5.Give an undertaking to work for at least 5 years for the company. However
a) If the candidate fullls all conditions except (1) then he/she should be referred to the Managing
Director of the company
b) If the candidate fullls all conditions except (4) then he/she should be referred to the chairman of the
company. Should the given candidate be selected ? ( The case is presented as on 1.12.2018)
23 year old Suresh is a technological student with uency in Hindi and English. He can pay Rs. 8000 as
deposit and will give ve years undertaking

 Candidate is to referred to the chairman

 

2.

Instructions- Choose the answer option that arranges the given set of words in the most meaningful
order. The words when put in order should make logical sense according to size, quality, quantity, the
occurrence of events, value, appearance, nature, process etc.
1.Probation
2.Interview
3.Selection
4.Appointment letter
5.Advertisement
6.Application
\
5,6,2,3,4,1
5,6,3,2,4,1
5,6,4,2,3,1

6,5,4,3,2,1

 

3.

Passage:
(i) Suman, Vicky, Santosh, Mohan, Alok, Sagar, Shekhar are standing on a wall and all of them are facing
west. (ii) Suman is on the immediate left of Alok. (iii) Mohan is at an extreme end and has Santosh as his
neighbour. (iv) Alok is standing third from the south end (v) Sagar is between Santosh and Shekhar. Who
is standing to the left of Santosh ?
Mohan
Sagar
Shekhar
Vicky

 

4.

Passage: (i) Suman, Vicky, Santosh, Mohan, Alok, Sagar, Shekhar are standing on a wall and all of them are
facing west. (ii) Suman is on the immediate left of Alok. (iii) Mohan is at an extreme end and has Santosh
as his neighbour. (iv) Alok is standing third from the south end (v) Sagar is between Santosh and
Shekhar. Which of the following pairs of people are standing at extreme ends?
Mohan and Vicky
Mohan and Suman
Vicky and Suman
Mohan and Alok

 

5.

Problem question: This year, on which day, does Rohit's birthday fall? Statements: I) His birthday falls
between October 27 and 30, October 27 being a Tuesday. II) His birthday is not on Thursday.
Statement I alone is Sufcient
Statement II alone is sufcient
Both statements put together are sufcient
Both the statements even put together are not sufcient
 

 

6.

In the question each passage consists of six sentences. The first and the sixth sentences are given in
the beginning. The middle four sentences have been removed and jumbled up. These are labeled P, Q, R
and S. Select the proper order for the four sentences.
S1: Hi Sandeep, hope all is well with you.
P: We all went for a short trip last weekend to Rishikesh for camping and rafting.
Q: It was a lot of fun as we all stayed in camp at the river side.
R: Everybody here is doing great.
S: There weren't many rapids in the river this year due to less rain.
S6: Nonetheless, we had great fun while rafting.
PSRQ
SPQR
RPQS

QPRS

 

7.

There are ways to spice up one's work. And I am surely not asking you to be an ofce gossip-monger.
There are predominantlythree kinds of people at a work place. Firstly, the ones who work for money
alone, and wouldn't devote even an iota of their time beyond the 9-5 ofce timings. They are usually not
happy with what they are doing, unlike the others. Secondly, there are those, for whom, work is a means
of getting appreciation and rewards. They are happy if they feel their efforts are being acknowledged
and rewarded. They stretch themselves to nish their work on time and are an asset to the organization.
Thirdly, the ones who consider work as an end in itself. They put their heart and soul into their work and
never worry about rewards. I am just asking you to try and transform yourself into one of the latter two
The writer is a professional career counselor in the organization.
People belonging to the second and third kinds are have higher job satisfaction.
Rewarding the rst and second kind of people at work place encourages them to do better.
The third kind of people at workplace are the best assets for the organization.

 

8.

The question consists of a problem question followed by two statements I and II. Find out if the
information given in the statement(s) is sufcient in nding the solution to the problem. Problem
question: How is sangeeta related to Manoj? Statements: I) Manoj is the only son of Sangeeta's father II)
Rohit is Manoj's father
Statement I alone is Sufcient
Statement II alone is sufcient
Both statements put together are sufcient
Both the statements even put together are not sufcient
Either of the statements is sufcient

 

9.

Passage: (i) Suman, Vicky, Santosh, Mohan, Alok, Sagar, Shekhar are standing on a wall and all of them are
facing west. (ii) Suman is on the immediate left of Alok. (iii) Mohan is at an extreme end and has Santosh
as his neighbour. (iv) Alok is standing third from the south end (v) Sagar is between Santosh and
Shekhar. Name the person who should change his position with Alok such that he gets the second place
from the north end?
Shekhar
Vicky
Sagar
Santosh

 

10.

Choose the answer option that arranges the given set of words in the most meaningful order. The words
when put in order should make logical sense according to size, quality, quantity, the occurrence of
events, value, appearance, nature, process etc. (i) Shooting (ii) Story (iii) Editing (iv) Release (v) Casting
1, 2, 3, 4, 5
2, 5, 1, 4, 3
2, 5, 1, 3, 4
5, 2, 3, 1, 4

 

11.

Saurabh along with his son Nishan had to go to his brother's paternal uncle's sister's husband's fatherin-law's only granddaughter's house. Nishan has to go to whose house?
Sister
Aunt
Brother
Daughter

 

12.

Find the next number in the series. 3, 15, 35, 63, ...
101
121
99
98

 

13.

If RESULT is coded as SFTVMU, then EXAM is coded as:
FWBO
DYZL
FYBN
DXZL

 

14.

Pointing to a man, a girl said, He is the husband of the grand-daughter of the mother of my mother. How
is the man related to the girl?
Cousin
Brother-in-law
Brother
Father

 

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

 Verbal Ability

1.

Select the option that is most nearly opposite in meaning to the given word TORTURE (OPPOSITE)
Friendly
Generous
Polite
Aid

 

2.

Read the following passage and answer the question given below:
Fasting is an act of homage to the majesty of appetite. So, I think we should arrange to give up our
pleasures regularly-our food, our friends, our lovers- in order to preserve their intensity and the
moment of coming back to them. For this is the moment that renews and refreshes both oneself and
the thing one loves. Sailors and travelers enjoyed this once, and so did hunters, I suppose. Part of the
weariness of modern life may be that we live too much on top of each other and are entertained and
fed too regularly. Once we were separated by hunger both from our food and families, and then we
learned to value both. The men went off hunting, and the dogs went with them; the women and
children waved goodbye. The cave was empty of men for days on end; nobody ate or knew what to do.
The women crouched by the re, the wet smoke in their eyes; the children wailed; everybody was
hungry. Then one night there were shouts and the barking of dogs from the hills, and the men came
back loaded with meat. This was the great reunion, and everybody gorged themselves silly, and
appetite came into its own; the long-awaited meal became a feast to remember and an almost sacred
celebration of life. Now we go off to the office and come home in the evenings to cheap chicken and
frozen peas. What commonality has been highlighted between the sailors and hunters?

they were regularly...................

 

3.

Select the word or phrase which best expresses the meaning of the given word. CRUCIAL
Naive
Dispensable
Essential
Useful
 

 

4.

Select the word or phrase which best expresses the meaning of the given word. VANISH
Evacuate
Decrease
Disappear
Harm

 

5.

Select the correct answer option based on the passage Sixty years ago, on the evening of August 14,
1947, a few hours before Britain's Indian Empire was formally divided into the nationstates of India and
Pakistan, Lord Louis Mountbatten and his wife, Edwina, sat down in the viceregal mansion in New Delhi
to watch the latest Bob Hope movie, "My Favorite Brunette." Large parts of the subcontinent were
descending into chaos, as theimplications of partitioning the Indian Empire along religious lines
became clear to the millions of Hindus, Muslims, and Sikhs caught on the wrong side of the border. In
the next few months, some twelve million people would be uprooted and as many as a million
murdered. But on that night in mid-August the bloodbath and the fuller consequences of hasty
imperial retreat still lay in the future, and the Mountbatten probably felt they had earned their evening's
entertainment. Mountbatten's, the last viceroy of India, had arrived in New Delhi in March, 1947, charged
with an almost impossible task. Irrevocably enfeebled by the Second World War, the British belatedly
realized that they had to leave the subcontinent, which had spiraled out of their control through the
nineteen-forties. But plans for brisk disengagement ignored messy realities on the ground.
Mountbatten had a clear remit to transfer power to the Indians within fteen months. Leaving India to
God, or anarchy, as Mohandas Gandhi, the foremost Indian leader, exhorted, wasn't a political option,
however tempting. Mountbatten had to work hard to gure out how and to whom power was to be
transferred. The dominant political party, the Congress Party, took inspiration from Gandhi in claiming
to be a secular organization, representing all four hundred million Indians. But many Muslim politicians
saw it as a party of upper-caste Hindus and demanded a separate homeland for their hundred million
coreligionists, who were intermingled with non-Muslim populations across the subcontinent's villages,
towns, and cities. Eventually, as in Palestine, the British saw partition along religious lines as the
quickest way to the exit. But sectarian riots in Punjab and Bengal dimmed hopes for a quick and
dignied British withdrawal, and boded ill for India's assumption of power. Not surprisingly, there were
some notable absences at the Independence Day celebrations in New Delhi on August 15th. Gandhi,
denouncing freedom from imperial rule as a "wooden loaf," had remained in Calcutta, trying, with the
force of his moral authority, to stop Hindus and Muslims from killing each other. His great rival
Mohammed Ali Jinnah, who had fought bitterly for a separate homeland for Indian Muslims, was in
Karachi, trying to hold together the precarious nation-state of Pakistan. Nevertheless, the signicance of
the occasion was not lost on many. While the Mountbatten's were sitting down to their Bob Hope
movie, India's constituent assembly was convening in New Delhi. The moment demanded
grandiloquence, and Jawaharlal Nehru, Gandhi's closest disciple and soon to be India's rst Prime
Minister, provided it. "Long years ago, we made a tryst with destiny," he said. "At the stroke of the
midnight hour, while the world sleeps, India will awaken to life and freedom. A moment comes, which

He uses it to show the apathy...

 

6.

Improve the sentence by selecting the correct alternative to the italicized part of the sentence
According to a recent research by experts, many women's became victims of trafcking.
Women’s are becoming
Women becomes
Women became
No improvement needed
 

 

7.

Select the correct answer option based on the passage Sixty years ago, on the evening of August 14,
1947, a few hours before Britain's Indian Empire was formally divided into the nationstates of India and
Pakistan, Lord Louis Mountbatten and his wife, Edwina, sat down in the viceregal mansion in New Delhi
to watch the latest Bob Hope movie, "My Favorite Brunette." Large parts of the subcontinent were
descending into chaos, as the implications of partitioning the Indian Empire along religious lines
became clear to the millions of Hindus, Muslims, and Sikhs caught on the wrong side of the border. In
the next few months, some twelve million people would be uprooted and as many as amillion
murdered. But on that night in mid-August the bloodbath and the fuller consequences of hasty
imperial retreat still lay in the future, and the Mountbatten's probably felt they had earned their
evening's entertainment. Mountbatten, the last viceroy of India, had arrived in New Delhi in March, 1947,
charged with an almost impossible task. Irrevocably enfeebled by the Second World War, the British
belatedly realized that they had to leave the subcontinent, which had spiraled out of their control
through the nineteen-forties. But plans for brisk disengagement ignored messy realities on the ground.
Mountbatten had a clear remit to transfer power to the Indians within fteen months. Leaving India to
God, or anarchy, as Mohandas Gandhi, the foremost Indian leader, exhorted, wasn't a political option,
however tempting. Mountbatten had to work hard to gure out how and to whom power was to be
transferred. The dominant political party, the Congress Party, took inspiration from Gandhi in claiming
to be a secular organization, representing all four hundred million Indians. But many Muslim politicians
saw it as a party of upper-caste Hindus and demanded a separate homeland for their hundred million
coreligionists, who were intermingled with non-Muslim populations across the subcontinent's villages,
towns, and cities. Eventually, as in Palestine, the British saw partition along religious lines as the
quickest way to the exit. But sectarian riots in Punjab and Bengal dimmed hopes for a quick and
dignied British withdrawal, and boded ill for India's assumption of power. Not surprisingly, there were
some notable absences at the Independence Day celebrations in New Delhi on August 15th. Gandhi,
denouncing freedom from imperial rule as a "wooden loaf," had remained in Calcutta, trying, with the
force of his moral authority, to stop Hindus and Muslims from killing each other. His great rival
Mohammed Ali Jinnah, who had fought bitterly for a separate homeland for Indian Muslims, was in
Karachi, trying to hold together the precarious nation-state of Pakistan. Nevertheless, the signicance of
the occasion was not lost on many. While the Mountbatten's were sitting down to their Bob Hope
movie, India's constituent assembly was convening in New Delhi. The moment demanded
grandiloquence, and Jawaharlal Nehru, Gandhi's closest disciple and soon to be India's rst Prime
Minister, provided it. "Long years ago, we made a tryst with destiny," he said. "At the stroke of the
midnight hour, while the world sleeps, India will awaken to life and freedom. A moment comes, which

A symbol of the ills...

 

8.

Select the correct option that lls the blanks(s) to make the sentence meaningfully complete.
The origin of attention decit disorder (ADD), as believed by many medical experts can be congenital,
whereas others believe it to be ____.
Exogenous
Deleterious
Pathological
Environmental
 

 

9.

In the question each passage consists of six sentences. The first and the sixth sentences are given in
the beginning. The middle four sentences have been removed and jumbled up. These are labeled P, Q, R
and S. Select the proper order for the four sentences.
S1: Hi Sandeep, hope all is well with you.
P: We all went for a short trip last weekend to Rishikesh for camping and rafting.
Q: It was a lot of fun as we all stayed in camp at the river side.
R: Everybody here is doing great.
S: There weren't many rapids in the river this year due to less rain.
S6: Nonetheless, we had great fun while rafting.

RPQS

 

10.

Select the correct answer option based on the passage Sixty years ago, on the evening of August 14,
1947, a few hours before Britain's Indian Empire was formally divided into the nationstates of India and
Pakistan, Lord Louis Mountbatten and his wife, Edwina, sat down in the viceregal mansion in New Delhi
to watch the latest Bob Hope movie, "My Favorite Brunette." Large parts of the subcontinent were
descending into chaos, as the implications of partitioning the Indian Empire along religious lines
became clear to the millions of Hindus, Muslims, and Sikhs caught on the wrong side of the border. In
the next few months, some twelve million people would be uprooted and as many as a million
murdered. But on that night in mid-August the bloodbath and the fuller consequences of hasty
imperial retreat still lay in the future, and the Mountbatten's probably felt they had earned their
evening's entertainment. Mountbatten, the last viceroy of India, had arrived in New Delhi in March, 1947,
charged with an almost impossible task. Irrevocably enfeebled by the Second World War, the British
belatedly realized that they had to leave the subcontinent, which had spiraled out of their control
through the nineteen-forties. But plans for brisk disengagement ignored messy realities on the ground.
Mountbatten had a clear remit to transfer power to the Indians within fteen months. Leaving India to
God, or anarchy, as Mohandas Gandhi, the foremost Indian leader, exhorted, wasn't a political option,
however tempting. Mountbatten had to work hard to gure out how and to whom power was to be
transferred. The dominant political party, the Congress Party, took inspiration from Gandhi in claiming
to be a secular organization, representing all four hundred million Indians. But many Muslim politicians
saw it as a party of upper-caste Hindus and demanded a separate homeland for their hundred million
coreligionists, who were intermingled with non-Muslim populations across the subcontinent's villages,
towns, and cities. Eventually, as in Palestine, the British saw partition along religious lines as the
quickest way to the exit. But sectarian riots in Punjab and Bengal dimmed hopes for a quick and
dignied British withdrawal, and boded ill for India's assumption of power. Not surprisingly, there were
some notable absences at the Independence Day celebrations in New Delhi on August 15th. Gandhi,
denouncing freedom from imperial rule as a "wooden loaf," had remained in Calcutta, trying, with the
force of his moral authority, to stop Hindus and Muslims from killing each other. His great rival
Mohammed Ali Jinnah, who had fought bitterly for a separate homeland for Indian Muslims, was in
Karachi, trying to hold together the precarious nation-state of Pakistan. Nevertheless, the signicance of
the occasion was not lost on many. While the Mountbatten's were sitting down to their Bob Hope
movie, India's constituent assembly was convening in New Delhi. The moment demanded
grandiloquence, and Jawaharlal Nehru, Gandhi's closest disciple and soon to be India's rst Prime
Minister, provided it. "Long years ago, we made a tryst with destiny," he said. "At the stroke of the
midnight hour, while the world sleeps, India will awaken to life and freedom. A moment comes, which

His asassin thought he ...

 

11.

Arrange the fragments A, B, C, D, E and F in order to form a meaningful sentence A- disappointed if Bnot fullled C- do not be D- or E- promises are F- friends let you down
CFDAEB
CABDEF
CAFDBE
CAFDEB
 

 

12.

Select the word or phrase which best expresses the meaning of the given word. Sumptuous
Luxurious
poor
Musty
destitute

 

13.

Read the sentence to nd out whether there is any grammatical error in it The error, if any, will be in one
part of the sentence. The letter of that part is the answer. Ignore the error of punctuation, if any.
(A)Everyone need to understand (B) that it is important to (C) respect his/her parents
a
b
c
No error

 

14.

There are ways to spice up one's work. And I am surely not asking you to be an ofce gossip-monger.
There are predominantlythree kinds of people at a work place. Firstly, the ones who work for money
alone, and wouldn't devote even an iota of their time beyond the 9-5 ofce timings. They are usually not
happy with what they are doing, unlike the others. Secondly, there are those, for whom, work is a means
of getting appreciation and rewards. They are happy if they feel their efforts are being acknowledged
and rewarded. They stretch themselves to nish their work on time and are an asset to the organization.
Thirdly, the ones who consider work as an end in itself. They put their heart and soul into their work and
never worry about rewards. I am just asking you to try and transform yourself into one of the latter two
The writer is a professional career counselor in the organization.
People belonging to the second and third kinds are have higher job satisfaction.
Rewarding the rst and second kind of people at work place encourages them to do better.
The third kind of people at workplace are the best assets for the organization.

people belonging to the second....

 

15.

Select the correct option that lls the blanks(s) to make the sentence meaningfully complete Neither
Surekha ____ Ravi will be able to attend the meeting on Sunday.
or
nor
and
but also

 

16.

Read the following passage and answer the question below: Fasting is an act of homage to the majesty
of appetite. So, I think we should arrange to give up our pleasures regularly-our food, our friends, our
lovers- in order to preserve their intensity, and the moment of coming back to them. For this is the
moment that renews and refreshes both oneself and the thing one loves. Sailors and travellers enjoyed
this once, and so did hunters, I suppose. Part of the weariness of modern life may be that we live too
much on top of each other and are entertained and fed too regularly. Once we were separated by
hunger both from our food and families, and then we learned to value both. The men went off hunting,
and the dogs went with them; the women and children waved goodbye. The cave was empty of men for
days on end; nobody ate or knew what to do. The women crouched by the re, the wet smoke in their
eyes; the children wailed; everybody was hungry. Then one night there were shouts and the barking of
dogs from the hills, and the men came backloaded with meat. This was the great reunion, and
everybody gorged themselves silly, and appetite came into its own; the long-awaited meal became a
feast to remember and an almost sacred celebration of life. Now we go off to the ofce and come home
in the evenings to cheap chicken and frozen peas. What is the author's main argument in the passage?

we should deny....

 

17.

Read the sentence to nd out whether there is any grammatical error in it The error, if any, will be in one
part of the sentence. The letter of that part is the answer. Ignore the error of punctuation, if any. (A)Juhu
beach in Mumbai was filled with (B) innumerable people who had gathered there (C) to see the
discovered newly ancient temple.
a
b
c
d

 

18.

Select the correct option that lls the blanks(s) to make the sentence meaningfully complete Garima
said, "There are so many people in the house, I wonder who ate the ice-cream." Garima is _.
doubtful
amazed
shocked
worried
 

 

19.

Select the option that is most nearly opposite in meaning to the given word PERENNIAL (OPPOSITE)
Frequent
Regular
Lasting
Rare

 

20.

The note books used by ___ 'Evergreen' society are made of recycled paper.
a
an
the
all
 

 

21.

Select the correct option that lls the blanks(s) to make the sentence meaningfully complete
Increasing amount of junk from computers in America has forced them to recycle it for further use. One
of the ___ units is set up in India.
recycles
recycled
recycling
recycle

 

22.

Improve the sentence by selecting the correct alternative to the italicized part of the sentence As per
the weather prediction, it will rain heavily for the next one week.
Observation
Report
News
Forecast

 

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

Programming

1.

Problem Statement
Bangalore City, where peace prevails most of the time. Not everyone is a huge fan of peace, though.
Certainly not Mr. XYZ, whose identity is not known to us - yet. Mr. XYZ has somehow managed to bring
vampires and zombies to Bangalore City to attack and destroy the city.
Fatal Eagle, an ordinary citizen of the city is extremely worried on seeing his city being attacked by
these weird creatures. But, as of now, he has no power to stop these creatures from their silent attacks.
He wants to analyze these creatures firstly. He figured out some things about these creatures, like:
Zombies have power in terms of an EVEN number.
Vampires have power in terms of an ODD number.
If he sees a zombie or a vampire, he marks them in his list with their power. After generating the entire
list of power of these creatures, he decides to arrange this data in the following manner:
All the zombies arranged in sorted manner of their power, followed by the total power of zombies.
All the vampires arranged in sorted manner of their power, followed by the total power of vampires.
You've to help him produce the following list to help him save his city.
Input Format
The first line of input will contain an integer — N, denoting the number of creatures.
The next line will contain N integers denoting the elements of the list containing the power of zombies
and vampires.
Output Format
Print the required list in a single line

PYTHON CODE:

 

n = int(input())
p = [int(i) for i in input().split()]
p= sorted(p)
zom = [ ]
vamp = [ ]
for i in range(n):
  if(p[i]%2==0):
    zom.append(p[i])
  else:
    vamp.append(p[i])
print(*zom,sum(zom),*vamp,sum(vamp))


2.

Problem statement
Little Robert likes mathematics. Today his teacher has given him two integers and asked to find out
how many integers can divide both the numbers. Would you like to help him in completing his school
assignment?
Input Format
There are two integers, a and b as input to the program.
Constraints
Output Format
Print the number of common factors of a and b.
Sample Input:
10 15
Sample Output:
2

python code:

 

data  = input()
li = data.split()
 
a = int(li[0])
b = int(li[1])
 
def gcd(a, b):
    if (a == 0):
        return b;
    return gcd(b%a, a);
 
if (a>0 and a<(10**12+1) and b>=1 and b<(10**12+1)):
    count = 1
    for i in range(2, gcd(a, b)+1):
        if a%i==0 and b%i==0:
            count = count+1
    print(count)

 

 

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Post a Comment

Previous Post Next Post