Hi, i'm new here, i've a little problem, in this script i find the elements (numbers) of an array: <cfif Array100 is num1 > and then i do what i need, i would like to do it in this way: <cfif Array100 is num1 and his multiple> so, if num1 is 2, i want to find also 4, 6 8 , etc is there any solution or do i have to use a loop to find the multiples? Thank you very much.
I think one thing you will need to establish is how high you want to go in your search for multiples. Given your example of 2, it would be very easy to write a recursive function where on each iteration of your loop you just go to the next multiple of your number and loop through your array looking for a match. However, this is could quickly turn into a lot of processing, and if you don't set limits like "only loop to the 8th multiple of a number", you could find yourself in an endless loop. Here is my question though.... why? I can't think of a real world case for a problem like this. It sounds much more like a class assignment!