Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package averager;
- import java.util.Scanner;
- public class Average {
- public static void main(String[] args) {
- Scanner scan = new Scanner (System.in);
- System.out.println("Input the first integer");
- int n1 = scan.nextInt();
- System.out.println("Input the second integer");
- int n2 = scan.nextInt();
- System.out.println("Input the third integer");
- int n3 = scan.nextInt();
- System.out.println("Your values are " + n1 + ", " + n2 + ", and " + n3);
- double average = ((n1+n2+n3)/3);
- System.out.println("Your average is " + average);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement