im having trouble and cant find whats wrong... plz help
#include "strlib.h"
#include "simpio.h"
#include "genlib.h"
#include "string.h"
int main()
{
int i, high;
string answer;
printf("Think of a number in the range of 1-");
high = GetInteger();
printf("and I'll guess it:\nPlease use Y and N.\n");
answer = "No";
printf("Is the number %d ",high/2);
answer = GetLine();
if(StringCompare(answer, "N") == 0)
{
printf("\nIs the number lower than %d? ",high/2);
answer = GetLine();
if(StringCompare(answer, "Y") == 0)
{
for(i=(high/2)/2; i>1; i=i/2)
{
printf("\nIs the number %d?\n", i);
answer = GetLine();
if(StringCompare(answer, "N") == 0)
{
printf("\nIs the number lower than %d?\n", i);
answer = GetLine();
}
else
{
i=1;
}
if(StringCompare(answer, "N") == 0)
{
for(i=i+1; i<i*2; i++)
{
printf("\nIs the number %d?\n", i);
answer = GetLine();
if(StringCompare(answer, "Y") == 0)
{
i=500;
}
else;
}
}
else;
}
}
else if(StringCompare(answer, "N") == 0)
{
for(i=(high/2)+high; i<high; i=(i/2)+i)
{
printf("\nIs the number %d?\n", i);
answer = GetLine();
if(StringCompare(answer, "N") == 0)
{
printf("\nIs the number higher than %d?\n", i);
answer = GetLine();
}
else
{
i=1;
}
if(StringCompare(answer, "N") == 0)
{
for(i=i-1; i>i/2; i--)
{
printf("\nIs the number %d?\n", i);
answer = GetLine();
if(StringCompare(answer, "Y") == 0)
{
i=1;
}
else;
}
}
else;
}
}
}
else;
printf("I have succeeded in guessing your number!\n");
system("pause");
}