Quote:
Originally Posted by xpi0t0s View Post
> even if it is not divisible it still produces the results

I thought it was supposed to produce results if it is not divisible. It's if it IS divisible that the number isn't valid.
What number did you enter?
After cin>>x you could try displaying the number entered as a check that x contains what you're expecting.

Why is your loop variable i a double?

O yes you are correct. It's one of those things where you know what you meant but typed it wrong. i should be int, I don't know why I had double. An example number I entered would be 346555. If it IS divisible then I want the program to tell the user the number is not valid and end. If it is NOT divisible then I want the program to continue and loop out the ten random numbers.