URI Problem (Odd Numbers) 1067 Solution in Java

Problem Solving, URI

URI Problem (Odd Numbers) 1067:
Odd Numbers is a basic problem on URI online judge for novice problem solver.
You can find details on this Link.

import java.util.Scanner;

/**
 * @Author : Muhammad Harun-Or-Roshid
 * @Date : Oct 14, 2016
 * @Time : 9:30:14 PM
 */
public class Uri1067 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        if (x >= 1 && x <= 1000) {
            for (int i = 1; i <= x; i++) {
                if (i % 2 != 0) {
                    System.out.println(i);
                }
            }
        }
    }
}

0 Comments

You may find interest following article