Can someone tell me how to complete this task? I really cannot get it!
The question says:
Implement public static void div (int a, int b).
This method should divide the first number by the second number and display the result of a divided by B.
The result displayed should be an integer.
Requirement:
The div method must divide a by B.
The div method must show the result of the division.
The main method should call the div method three times.
The main method should not call the screen output method.
The program should output three numbers: 2 1 0. One row per number.
package zh.codegym.task.task03.task0301;
/*
分裂是好的
*/
public class Solution {
public static void main(String[] args) {
div(6, 3);
div(10, 6);
div(2, 4);
}
public static void div(int a, int b) {
//在此编写你的代码
int x1 = 6/3;
int x2 = 10/6;
int x3 = 2/4;
System.out.println(x1);
System.out.println(x2);
System.out.println(x3);
}