Search:

Type: Posts; User: User2009

Search: Search took 0.34 seconds.

  1. Re: Write a Java program to calculate the modules of two numbers without using any inbuilt modulus operator.

    The key is in the data types of the variables.



    The value in the variable "divided" will be 2 because of its data type which is int.

    You can confirm this by adding this line:
    ...
  2. Re: Write a Java program to calculate the modules of two numbers without using any inbuilt modulus operator.

    I'm assuming the "totally different" answer you're getting on a calculator is zero.
    If that is the case then the reason is in the type of the variables... particularly the variable "divided".
    ...
Results 1 to 2 of 2