wiley_pastebin

lesson 2 break 1

Mar 15th, 2019
2,075
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.14 KB | None | 0 0
  1. int[] nums = {2, 4, -3, 5, -7};
  2. int firstNegative = 0;
  3. for(int num : nums){
  4.  if(num < 0){
  5.   firstNegative = num;
  6.   break;
  7.  }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment