Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class asd {
- public static void main(String[]args)
- {
- int input,s,w,sum=0,a=0,x=1;
- Scanner in = new Scanner(System.in);
- System.out.println("How many Numbers You want to Intput: ");
- input=in.nextInt();
- do{
- System.out.print(x +" ");
- System.out.println("Number: ");
- a=in.nextInt();
- sum=sum+a;
- x++;
- }
- while(x<=input);
- s=sum/input;
- System.out.println("The Average is: " +s);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement