ok so the computers supposed to guess my number however when i go to run it it asks what my repsonse to its guess is and shuts down. Anyone that can help? I would much appreciate it
Code:
#include <stdio.h>
int
main(void)
{
/* variables */
int min, max, guess;
char response;
min = 1;
max = 100;
guess = (max + min / 2);
/* Asks the user to pick a number*/
printf("Think of a number in the range of 1-100\n");
/* Applys first guess */
printf("My guess is %d, whats your response? (>,<, or =)\n", guess);
scanf("%c", response);
while (response != '=')
{
printf("My guess is %d, whats your response? (>,<, or =)", guess);
scanf("%c", response);
if (response == '>')
{
min = ( max + min / 2);
}
else
{
if (response == '<')
{
max = ( max + min / 2);
}
else
{
printf("I Win");
}
}
}
system("pause");
return (0);
}