ODD Number Series



package exam;

public class Program2 {
 public static void main(String[] args) {
  int n=5;
  for(int i=1;i<=n;i++) {
   System.out.print(" " +(2*i-1));
  }
 }

}


o/p:-
 1 3 5 7 9