Solved

Mod function in Java...

Posted on 2006-06-27
1
1,480 Views
Last Modified: 2012-08-14
What is the most simple way to get the quotient and remainder for in Java? is there a native mod function?
0
Comment
Question by:JavaConvert
1 Comment
 
LVL 16

Accepted Solution

by:
imladris earned 50 total points
ID: 16993238
Yup. You can use % to get a remainder.


i=7/3;
j=7%3;


i will wind up with 2, j with 1.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Application launch issue with Apache Tomcat 5 22
Java array passed to SQL where clause 23 62
eclipse argument 14 53
Java SE 8u111  Lot of stuff broke 11 54
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This video teaches viewers about errors in exception handling.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now