if (number = array[count] )
{
cout << "the number is in memory position " << count << endl;
cout << "it took " << counta << "passes to find it" << endl;
}
}
if (number != linearsearch)
{
cout << " the number is not in memory position " << count << endl;
}
cout <<"the numbers in ascending order are :" << endl;
return 0;
}
The array elements run from 0 up to and including 19. check your for loop - it stops when it reaches 19. Also - remove the semicolon on that first for statement line.
Not sure why you are incrementing count in the for loop? It's already being incremented in the for statement.
If you're checking for equality, use == not the assignment operator =