hi everyone am trying to write a very small interactive program that 'thinks' of a number in the range of 0 to 99 and asks the user to guess it , problem is when i compile it (using devc++) I get errors (six to be exact) I don't know what is going on , below is the code , i know there is always someone out there to help :cheesy: thanx p.s please explain what the rand() function exactly is, thanx again
#include <stdio.h>
main()
{
int target;
int guess;
int again;
printf("n Do you want to guess a number 1 =Yes, 0=No ");
scanf("%d",&again);
while (again)
{
target = rand() % 100;
} guess = target + l;
while(target!=guess)
{
printf('n What is your guess ? ");
scanf("%d",&guess);
if (target>guess) printf("Too low");
else printf("Too high");
}
printf("n Well done you got it! n");
printf("n Do you want to guess a number 1=Yes, 0=No");
scanf("%d".&again);
system("PAUSE");
return 0;
}
}