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
What is the difference between array and structure in c?
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
What is the purpose of & in scanf?
What are inbuilt functions in c?
How can I read a binary data file properly?
Where does the name "C" come from, anyway?
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);
What is pointer to pointer in c?
What is structure padding and packing in c?
Why c is called top down?
How main function is called in c?
What is call by value in c?
What does it mean when the linker says that _end is undefined?
What is mean by data types in c?
Why can arithmetic operations not be performed on void pointers?