this is a program to play battleship but when I enter 10 it does not display the X? can someone give me any tips? I think the error is in the second for loop?
Thanks in advance, here is my code:
Your array size is 10. If you enter 10 the program checks if the answer is greater then 0, which is is, then it checks if the answer is less then the SIZE, which is 10. Since 10 is NOT less then 10, the statement evaluates to false, and the next line is never executed. what you want is:
@pogrady thanks!! yes I changed that but it still does not print the X when I type 10 maybe it's because the array size is from 0 to 10 and the 9th spot is the last?? Can you give me more tips thanks