25. It takes five minutes to pass a rumour from one
person to two other persons. The tree of rumour continues.
Find how many minutes does it take spread the rumour to 768
persons. ?

Answers were Sorted based on User's Feedback



25. It takes five minutes to pass a rumour from one person to two other persons. The tree of rumou..

Answer / pradeep

Yes Bindu, You are right and thanks for correcting me.

and the right answer is 35 minutes.
Please find the logic and the program below:


int ppl , time , i , sum = 0;

printf("Enter the number of ppl u want to spread \r\n");
scanf("%d",&ppl);

while(sum<ppl)
{
sum = pow(3,i);
time = 5 * i;
i++;
}
printf("time in min required is %d \r\n",time);

[
out put:
Enter the number of ppl u want to spread
768
time in min required is 35
]
==================
For your refernce :
1->2 [ total 3 ppl ] took 5 min;
3 -> 6 [ total 9 ppl ] took 10 min
9 ->18 [ total 27 ppl ] took 15 min ..
27 -> 54 [ total 81 ppl ] took 20 min
81 -> 162 [ total 243 ppl ] took 25 min
243 -> 486 [ total 729 ppl ] took 30 min
729 -> 1458 [ total 2187 ppl ] took 35 min

overall it's power of 3
============================

Is This Answer Correct ?    19 Yes 3 No

25. It takes five minutes to pass a rumour from one person to two other persons. The tree of rumou..

Answer / manish panwar

// It's a combination of 1+2+4+8+16+.... and each intervl
takes 5 minutes.

SO

1+2+4+8+16+32+64+128+256+512+1024

11*5 = 55 MINTS IN TOTAL .

Is This Answer Correct ?    11 Yes 5 No

25. It takes five minutes to pass a rumour from one person to two other persons. The tree of rumou..

Answer / bindu

In the first 5 mins three people come to know of the
rumour; including the first person (who is still able to
spread the rumour!), i..e every 5 mins, three times the
people come to know of the rumour. So it just takes 30 mins
for 729 people and 35 mins for 2187 people to know of the
rumour.

Is This Answer Correct ?    8 Yes 2 No

25. It takes five minutes to pass a rumour from one person to two other persons. The tree of rumou..

Answer / bindu

But Pradeep, your logic assumes that the people who have
already passed the rumour in the first 5mins, will not pass
it again in the next 5mins!! In my logic, they keep on
passing it; 1.e. they don't stop after the first time.

Is This Answer Correct ?    5 Yes 0 No

25. It takes five minutes to pass a rumour from one person to two other persons. The tree of rumou..

Answer / karthiga

It takes 30 min only.

Is This Answer Correct ?    3 Yes 0 No

25. It takes five minutes to pass a rumour from one person to two other persons. The tree of rumou..

Answer / steve

45 minutes.

Is This Answer Correct ?    6 Yes 5 No

25. It takes five minutes to pass a rumour from one person to two other persons. The tree of rumou..

Answer / usha

Its 45 min becoz the Ist person spreeds rumour to 2person in
5 min. so in next 5 min the 2 person spreads simultaneously
to 4pesons and these steped is continued tel 45min, such as
2+4+8+16+32+64+128+256+512 this indicate at each addition it
take 5min. so the answer is 45min

Is This Answer Correct ?    2 Yes 1 No

25. It takes five minutes to pass a rumour from one person to two other persons. The tree of rumou..

Answer / dony

9*5+2.2=47.5min

Is This Answer Correct ?    0 Yes 0 No

25. It takes five minutes to pass a rumour from one person to two other persons. The tree of rumou..

Answer / pradeep

It requires 45 minutes:
Find the logic below:
int time;
for ( int i=0,SpreadRate=1,Ppl=0;Ppl<=768;i++)
{
Ppl = Ppl + SpreadRate;
time = 5 * i;
SpreadRate = SpreadRate * 2;

}
printf("time in min %d \r\n"),time);

Is This Answer Correct ?    2 Yes 3 No

25. It takes five minutes to pass a rumour from one person to two other persons. The tree of rumou..

Answer / pradeep

// It's a combination of 1+2+4+8+16+.... and each intervl
takes 5 minutes.
so use the below logic to find out the ryt answer

int time;
for ( int i=0,sum=0;sum<=768;i++)
{
sum = sum+(2*i);
time = 5*i;
}
printf("time in min %d \r\n"),time);

correct answer is 140 minutes [ nothng but 2 hours 20 min]

return TRUE;

Is This Answer Correct ?    4 Yes 12 No

Post New Answer

More C Interview Questions

Explain how do you generate random numbers in c?

0 Answers  


Write a program for the following series: 1*3*5-2*4*6+3*5*7-4*6*8+.................up to nterms

5 Answers   Convex Digital,


Why is c still so popular?

0 Answers  


DIFFERNCE BETWEEN THE C++ AND C LANGUAGE?

2 Answers   Wipro,


Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.

0 Answers  






what is the stackpointer

2 Answers  


What is a header file?

0 Answers  


What are the characteristics of arrays in c?

0 Answers  


Is a pointer a kind of array?

0 Answers  


What is meant by type specifiers?

0 Answers  


Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

0 Answers  


Write a program for the following series? 1 121 12321 1234321 123454321 12345654321 1234567654321 123456787654321 12345678987654321 1234567890987654321 123456789010987654321 12345678901210987654321 1234567890123210987654321 .........1234321............ ..........123454321............ ..........12345654321............ 7 8 9 0 1 Pls............?

5 Answers  


Categories