Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. System.out.println("Terminating value?");
  2. double tValue = IO.readDouble();
  3. double smallest = 0;
  4. double smallest2 = 0;
  5. double x = 0;
  6. int numx = 0;
  7. while (x != tValue)
  8. {
  9. numx++;
  10. System.out.println("Enter numbers");
  11. x = IO.readDouble();
  12. while (numx <2)
  13. {
  14. smallest = x;
  15. smallest2 = x;
  16. }
  17. if (x < smallest)
  18. {
  19. smallest2 = smallest;
  20. smallest = x;
  21. }
  22. else if (x < smallest2)
  23. {
  24. smallest2 = x;
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement