Computer Science, asked by praneeth5339, 9 months ago

PRINT THIS PATTERN IN JAVA 1 3 5 7 9 3 5 7 9 5 7 9 7 9 9

Answers

Answered by shanmuga89
3

Answer:

1113151719

Explanation:

here odd no are repeated

Answered by saiteja0555
5

Answer:

int n=new Scanner().nextInt();

for(int i=1;i<=n;i++)

{

for(int j=2*i-1;j<2*n;System.out.print( j ),j+=2);

}

Explanation:

it is a pattern in range of 5 or 10

for 10 remove even numbers and print

for 5 place 2*number-1 so u can get n th odd number

in this problem 2 loops were participating 1st one is for no of time second one is for printing value

Similar questions