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

Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)

7 Answers   Microsoft,


main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }

1 Answers  


what will be the output of this program? void main() { int a[]={5,10,15}; int i=0,num; num=a[++i] + ++i +(++i); printf("%d",num); }

3 Answers   Wipro,


main() { if (!(1&&0)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above

3 Answers   HCL,


main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

2 Answers  


write a program for area of circumference of shapes

0 Answers  


What is data _null_? ,Explain with code when u need to use it in data step programming ?

0 Answers   Abbott,


main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }

1 Answers  


main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }

1 Answers  


main() { int x=5; clrscr(); for(;x==0;x--) { printf("x=%d\n”", x--); } } a. 4, 3, 2, 1, 0 b. 1, 2, 3, 4, 5 c. 0, 1, 2, 3, 4 d. none of the above

3 Answers   HCL,


Find your day from your DOB?

15 Answers   Accenture, Microsoft,


main() { 41printf("%p",main); }8

1 Answers  


Categories