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'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 View All Answers
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);
Explain what is the general form of a c program?
What is the purpose of scanf() and printf() functions?
Write a program to reverse a linked list in c.
What are the different types of endless loops?
What are extern variables in c?
write a program to find out prime number using sieve case?
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
What is a lvalue
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
What are the different properties of variable number of arguments?
Where does the name "C" come from, anyway?
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
How do you declare a variable that will hold string values?