All was needed was to change while(i<w.length.....) to while(i<w.length-1....) . Works perfectly now. Thanks for your help once again :)
Type: Posts; User: Stockholm Syndrome
All was needed was to change while(i<w.length.....) to while(i<w.length-1....) . Works perfectly now. Thanks for your help once again :)
Sorry I dont fully understand. i++ is the only thing present in the loop body, i'm not sure where you mean to put it
static boolean member(int x, int[] w)
{
int i=0;
while(i<w.length &&...
Thanks very much for the help I appreciate it :) Regarding the loops, the only reason i use a while loop is because my lecturer showed us that way & said its the simplest way :D Personally, I don't...
Sorry yes i understand what you mean. I was looking at another example I had done and thats what was embedded in the if statement. What could i use to determine if x is found? Would it be correct to...
Hello, just wondering if anyone can help me with this problem. I had write a program which creates 100 random integers, each in the range 1 to 1000, inclusive. The user guesses a number and is told...