I am writing code in a new language where there are no large

I am writing code in a new language where there are no larger than \">\" or less than \">\" operations but you have +-/*.

I want to check if the input in the range [1...100] how I can do that?

Solution

If the range specifying value is not available, then one of the naive option is running a loop and setting a flag.

Consider this loop:

bool withinRange = false;

for(int i = 1; i !=101; i++)

if(value == i)

withinRange = true;

if(!withinRange)

Element is not within the range 1..100.

else

Element is within range

I am writing code in a new language where there are no larger than \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site