Advertisement
Guest User

Untitled

a guest
May 20th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. package averager;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Average {
  6.  
  7.     public static void main(String[] args) {
  8.        
  9.         Scanner scan = new Scanner (System.in);
  10.        
  11.         System.out.println("Input the first integer");
  12.         int n1 = scan.nextInt();
  13.        
  14.         System.out.println("Input the second integer");
  15.         int n2 = scan.nextInt();
  16.        
  17.         System.out.println("Input the third integer");
  18.         int n3 = scan.nextInt();
  19.        
  20.         System.out.println("Your values are " + n1 + ", " + n2 + ", and " + n3);
  21.        
  22.         double average = ((n1+n2+n3)/3);
  23.        
  24.         System.out.println("Your average is " + average);
  25.     }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement