Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner teclado= new Scanner(System.in);
- int num=0;
- double notas,suma=0;
- System.out.print("Cuantos numeros desea ingresar: ");
- num=teclado.nextInt();
- for (int i=0; i<num;i++)
- {
- System.out.println("nota");
- notas=teclado.nextDouble();
- suma=suma+notas;
- }
- double promedio=suma/num;
- System.out.println("Promedio: "+promedio);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement