Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package myApp;
- import java.util.Scanner;
- public class class03_03 {
- public static void main(String[] args) {
- //init vars
- int n = 0;
- //usage msg
- System.out.println("Integer: ");
- //open in_Stream, parse & close
- Scanner s = new Scanner(System.in);
- n = s.nextInt();
- s.close();
- //loop n+1 times (+1 to include 0 in our check)
- for (int i=0; i<=n; i++) {
- if (i%3 == 0) { System.out.println(i); } //check if i/3 = Integer, and print n if yes
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment