OneCompiler

Write a program to print the odd series up to n (where n is the range 0 to n)

132

import java.util.*;
public class oddseries {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("ENTER THE RANGE ");
int n = sc.nextInt();
for(int i=1;i<=n;i+=2)
System.out.println(i);
}
}