All i'm trying to do is get the program to ask the person to enter a number in an array then test weather the number is between 1-50, i've tried doing it within a for loop to save time, but for some reason the if statement doesn't seem to be working
The errors I get are:
24 D:\c++\assignment 2.cpp expected `;' before '(' token
and
24 D:\c++\assignment 2.cpp expected identifier before '(' token
Line 24 is the if statement btw. Thanks for any help guys!
In other words (it's clearer with code tags) the parens need to surround the entire condition of the if statement. In this case, there are only two tests so each test doesn't need it's own parens.
Change this: if (number[count] >= 1) && ( number[count] <=50)
to this if (number[count] >= 1 && number[count] <=50)