#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[5]={0,0,0,0,0};
int ans[5]={1,2,4,8,16};
cout<<"Think any number between 1 to 31"<<endl;
cout<<"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;
cout<<"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31"<<endl;
cout<<"if guess number available in the sequence,then enter 1 otherwise 0"<<endl;
cin>>a[0];
cout<<"2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31"<<endl;
cout<<"if guess number available in the sequence,then enter 1 otherwise 0"<<endl;
cin>>a[1];
cout<<"4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31"<<endl;
cout<<"if guess number available in the sequence,then enter 1 otherwise 0"<<endl;
cin>>a[2];
cout<<"8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31"<<endl;
cout<<"if guess number available in the sequence,then enter 1 otherwise 0"<<endl;
cin>>a[3];
cout<<"16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31"<<endl;
cout<<"if guess number available in the sequence,then enter 1 otherwise 0"<<endl;
cin>>a[4];
int answer=0,i;
for(i=0;i<5;i++)
{
if(a[i]==1)
{
answer=answer+ans[i];
}
}
cout<<"press any key to get answer"<<endl;
cout<<"your number is :"<<answer<<endl;
getch();

}






































