Java Arithmetic Operator Question 9

Question

We would like to calculate the result of the following remainders.

58 % 6 
74 % -4 
-28 %   5 
-34 % -5 
15 % 1 
11 % 5 


4
2
-3
-4
0
1
public class Main {
   public static void main(String[] args) {
      System.out.println( 58 % 6);
      System.out.println( 74 % -4);
      System.out.println( -28 % 5);
      System.out.println( -34 % -5);
      System.out.println( 15 % 1 );
      System.out.println( 11 % 5);
   }//from   w w w  . j  av  a 2 s . co m
}



PreviousNext

Related