I am very new at C , Any help would be greatly appreciated
This function is made to check the 2d array if guess matches num and loop untill the user enters -1.
the function call is not the problem its the return.
Code:int Find(int a[][SIZE],int num)
{
int y;
int x;
int guess=0;
while(num != -1)
{
for(x=0;x<SIZE;x++)/*loop 1*/
{
for(y=0;y<SIZE;y++)/*loop 2*/
{
guess = a[x][y];
if (num == guess )
{
return 1;
break;
}
else
{
printf("Keep Guessing:");
scanf("%d",&num);
}
}/* close loop 2*/
}/* close loop 1 */
}/*while */
return 0;
}/*Find*/