Advertisement
GabrielHr00

NumbersEndingIn7

Nov 20th, 2022
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. package S4_ForLoops;
  2.  
  3. public class NumbersEndingIn7 {
  4. public static void main(String[] args) {
  5.  
  6. // check for ending in 7
  7. for (int i = 7; i < 1000; i += 10) {
  8. if (i % 10 == 7) {
  9. System.out.println(i);
  10. }
  11. }
  12. }
  13. }
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement