StefanTobler

Lesson 24 Activity 2

Oct 27th, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. /*
  2.  * Lesson 24 Coding Activity 2
  3.  * Use a for loop to print the even numbers between 1 and 50.
  4.  * Print each number on a new line.
  5.  */
  6.  
  7. import java.util.Scanner;
  8. import java.lang.Math;
  9.  
  10. class Lesson_24_Activity_Two {
  11.     public static void main(String[] args)
  12.      {
  13.       for(int i = 2; i <= 50; i += 2)
  14.       System.out.println(i);
  15. }
  16. }
Add Comment
Please, Sign In to add comment