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
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 |
Post New Answer View All Answers
Why C language is a procedural language?
Write a program that accept anumber in words
When should the register modifier be used? Does it really help?
Can you please explain the difference between strcpy() and memcpy() function?
What are derived data types in c?
What are two dimensional arrays alternatively called as?
What is the difference between abs() and fabs() functions?
How can I remove the trailing spaces from a string?
What is function what are the types of function?
What is the value of uninitialized variable in c?
What do you mean by invalid pointer arithmetic?
How can I read and write comma-delimited text?
Which is best linux os?
What is a sequential access file?
What is void c?