Advertisement
Josif_tepe

Untitled

Oct 30th, 2024
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. public class Main
  2. {
  3.     public static void main(String[] args) {
  4.         int a = 10;
  5.         int b = 5;
  6.  
  7.         int sum = a + b;
  8.         int difference = a - b;
  9.         int product = a * b;
  10.         int quotient = a / b;
  11.  
  12.         System.out.println("The sum of the numbers is: " + sum);
  13.         System.out.println("The difference of the numbers is " + difference);
  14.         System.out.println("The product of the numbers is: " + product);
  15.         System.out.println("The quotient of the numbers is: " + quotient);
  16.        
  17.         double average = (double)(sum + difference + product + quotient) / 4.0;
  18.         System.out.println("The average of the results is: " + average);
  19.    
  20.     }
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement