Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package examen;
  7. import javax.swing.*;
  8. public class Examen {
  9.  
  10. /**
  11. * @param args the command line arguments
  12. */
  13. public static void main(String[] args) {
  14. String a, b;
  15. int num=0, count=0, suma=0, prom;
  16. while (num%13!=0){
  17. a=JOptionPane.showInputDialog("Ingrese un nro");
  18. num=Integer.parseInt(a);
  19. suma=suma+num;
  20. count=count+1;
  21. }
  22. if (num<100){
  23. prom=suma/count;
  24. System.out.println("el promedio de los nros es"+prom+" ");
  25. }
  26. if (num>=100){
  27. System.out.println("la cantidad de nros ingresados fue"+count+" ");
  28. }
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement