I am creating a program to 1) Generate a random 10 digit account number. 2) Have a user enter an account number that needs to match the generated account number.
If you have a ten digit account number, why are you comparing 11 numbers?
Also, the body of the for is wrong. As long as the last number processed is correct (even if all previous numbers in the 'guess' were incorrect,) CorrectAccountNumber will be 1.
In your generation function you generate 10 numbers, beginning at index 1.
In your compare function you compare 11 numbers beginning with index 0, so if the values at index 0 ever differ, CorrectAccountNumber can't be 1, even if all the actual numbers match.