aspose file tools*
The moose likes Beginning Java and the fly likes Dividing into two variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Dividing into two variables" Watch "Dividing into two variables" New topic
Author

Dividing into two variables

Peter Shipway
Ranch Hand

Joined: Mar 25, 2004
Posts: 71
Hey yo all me again
Is they a way to / a number into two differnt variables with the quoteint in one and the reminder in the other? eg.
10 / 4 = 2.5
x = 2
y = 5
Thanks much for any help.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

The "/" operator will give you the quotient; the "%" operator will give you the remainder (not a fraction, but the actual remainder.) SO you can do this with two operations.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dividing into two variables