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 the function. if all the character in string B appear in string A, return true, otherwise return false.

11 Answers   Google,


Program to find the largest sum of contiguous integers in the array. O(n)

11 Answers  


Under linux environment can u please provide a c code for computing sum of series 1-2+3-4+5......n terms and -1+2-3+4-5...n terms..

2 Answers  


write a c program to Create employee record by taking details like name, employee id, address and phone number. While taking the phone number, take either landline or mobile number. Ensure that the phone numbers of the employee are unique. Also display all the details

2 Answers   TCS,


programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h

1 Answers  






#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,


1) int i=5; j=i++ + i++ + i++; printf("%d",j);This code gives the answer 15.But if we replace the value of the j then anser is different?why? 2)int i=5; printf("%d",i++ + i++ + i++); this givs 18.

8 Answers   IBPS, Infosys, TCS,


#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }

1 Answers  


main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }

1 Answers  


main() { int i = 3; for (;i++=0;) printf(ā€œ%dā€,i); }

1 Answers   CSC,


how to return a multiple value from a function?

2 Answers   Wipro,


main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }

2 Answers   CSS, Wipro,


Categories