Advertisement
Gauge1417

Untitled

Mar 12th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. /* Gauge Smithee
  2. * MinMax
  3. * Mrs.Reagan
  4. * First Hour
  5. */
  6. public class Program {
  7.  
  8. public static void main(String[] args) {
  9.  
  10. int [] nums = {3,1,5,3};
  11. int i, smallest;
  12.  
  13. smallest = nums[0];
  14. i = 1;
  15. while(i < nums.length) {
  16. if(nums[i] > smallest)
  17. smallest = nums[i];
  18. i = i +1;
  19. }
  20. System.out.println (smallest);
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement