Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class even
- {
- public static void main(String[] args) {
- System.out.println("Enter a limit ");
- int limit=Integer.parseInt(System.console().readLine());
- System.out.println("Printing Even numbers between 1 and " + limit);
- for(int i=1; i <= limit; i++){
- if( i % 2 == 0){
- System.out.print(i + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement