- 1
b. Assign values to the variables. c. Pass both variables to methods named sum() and difference().
Create a Java program called Numbers with the following specifications.
1 ответ
+ 1
public class Numbers {
public static void main (String[] args) {
int a = 20;
int b = 10;
sum(a, b);
difference(a, b);
}
public static int sum(int a, int b) {
return a + b;
}
public static int difference(int a, int b) {
return a - b;
}
}