Here is the code that takes two numerical values from user input and performs various operations with them. However, expressions are missing, but the comments provide a description of what each line should print. Fill in the blanks with the appropriate expressions to achieve the desired outputs.
Integer types and operations
Integer operations
Report a typo
Fill in the gaps with the relevant elements
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
System.out.println(); // Sum of a and b
System.out.println(); // Difference of a and b
System.out.println(); // Product of a and b
System.out.println(); // Quotient of a divided by b
System.out.println(); // Remainder of a divided by b
System.out.println(); // Negation of a
System.out.println(); // Negation of b
}
} ___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.