Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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. ?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you override a defined macro?

1212


Is a house a shell structure?

1114


What is switch in c?

1049


What is clrscr in c?

1080


What is sizeof int in c?

1006


Write a c program to demonstrate character and string constants?

2117


What is the difference between typedef and #define?

997


What is non linear data structure in c?

972


How do you list a file’s date and time?

1028


What is header file definition?

1033


any "C" function by default returns an a) int value b) float value c) char value d) a & b

1046


How can I make sure that my program is the only one accessing a file?

1195


Do you have any idea how to compare array with pointer in c?

993


How can you find out how much memory is available?

1022


How can I use a preprocessorif expression to ?

1003