Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 If three numbers are divisible by two numbers
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DArch275




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: 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.
ScottD




PostPosted: 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
Insectoid




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: