Hey I was wondering about how you go about designing a IF statement that will use a range of values and if it was out of those range of values, e.g if it was a negative or if it exceeded a certain number, how do i go about creating a IF statement that follows these guidelines.
I have created a IF statement but it only accounts for 1 variable/value at a time and I would like to created a range of variables to be used e.g. 0 - 23953.
if (Download == 1)
{
cout << "1 megabytes downloaded" << endl;
}
else if (Download == 2)
{
cout << "2 megabytes downloaded" << endl;
}
else if (Download == 3)
{
cout << "3 megabytes downloaded" << endl;
I would like to make it so it goes from (1 - 10000)
If it is below 0 it poses a Error and the program closes or If it exceeds 10000 it poses a error and closes, and if any value is entered between 0 - 10000 it displays it on the screen perfectly without creating an error as the appropriate values are used.
Thanks Casey