plz tell me the solution..........

in c language program guess any one number from 1 to 50 and
tell that number within 8 asking question in yes or
no...............

Answers were Sorted based on User's Feedback



plz tell me the solution.......... in c language program guess any one number from 1 to 50 and ..

Answer / danish

he ask for 8 question
so it can be any 8 question ,
now use divide -conquer apprach to solve this problem as
Is it number <= 25
then, again split the range and within 8 question you can solve question......

GOOD BYE

Is This Answer Correct ?    5 Yes 0 No

plz tell me the solution.......... in c language program guess any one number from 1 to 50 and ..

Answer / abhisai

yes we can know it easily

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More C Code Interview Questions

Write a C program to print look and say sequence? For example if u get the input as 1 then the sequence is 11 21 1211 111221 312211 12112221 .......(it counts the no. of 1s,2s etc which is in successive order) and this sequence is used in run-length encoding.

1 Answers  


How can you relate the function with the structure? Explain with an appropriate example.

0 Answers  


write a c-program to display the time using FOR loop

3 Answers   HCL,


void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }

1 Answers   Honeywell,


Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }

1 Answers  






How will u find whether a linked list has a loop or not?

8 Answers   Microsoft,


#include<stdio.h> void fun(int); int main() { int a; a=3; fun(a); printf("\n"); return 0; } void fun(int i) { if(n>0) { fun(--n); printf("%d",n); fun(--n); } } the answer is 0 1 2 0..someone explain how the code is executed..?

1 Answers   Wipro,


There is a lucky draw held every day. if there is a winning number eg 1876,then all possible numbers like 1867,1687,1768 etc are the numbers that match irrespective of the position of the digit. Thus all these numbers qualify fr the lucky draw prize Assume there is no zero digit in any numbers. write a program to show all the possible winning numbers if a "winning number"is passed as an arguments to the function.

1 Answers   Nagarro,


void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }

1 Answers  


How to count a sum, when the numbers are read from stdin and stored into a structure?

1 Answers  


What is your nationality?

1 Answers   GoDB Tech,


1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.

3 Answers  


Categories