Computer Science Canada

If three numbers are divisible by two numbers

Author:  DArch275 [ Thu Nov 11, 2010 12:29 pm ]
Post subject:  If three numbers are divisible by two numbers

Hi, what I'm trying to understand is when I input three numbers, to get an output saying if they can divide by 3 and 5, and what the answer is(without a remainder), and if they can't i'm assuming I use elsif to say they can't.

But what I can't figure out is how to calculate if the three numbers can or not, thanks.

Author:  Insectoid [ Thu Nov 11, 2010 12:51 pm ]
Post subject:  RE:If three numbers are divisible by two numbers

Use integer division (div operator).

ie 5 div 2 = 2, as opposed to 5/2 = 2.5.

Author:  ScottD [ Mon Nov 15, 2010 10:01 pm ]
Post subject:  RE:If three numbers are divisible by two numbers

Somewhat confused at what your getting at, when you say input 3 numbers, is it adding those three numbers or doing anything with them? Or just putting out if each is divisible by 3 and 5 for example
15 is divisible by 3 and 5
30 is divisible by 3 and 5
45 is divisible by 3 and 5

Author:  Insectoid [ Tue Nov 16, 2010 12:02 am ]
Post subject:  RE:If three numbers are divisible by two numbers

If you have 3 inputs, just use a loop. Do it 3 times.


: