Computer Science, asked by dami20, 8 months ago

how to write an algorithm to print the first 10 odd numbers

Answers

Answered by anishaprasad301
2

Answer:

Basically the concept is;

Given is first 10 odd numbers.

Initialize a integer type variable with value equal to 1. say , int i=1;

Start a loop for the variable and run it twice the value of 10 = 20.

Print the value initialised in step 2+ 2. e.g; i+2;

Update the value of i as i+=2.

Answered by patel4536
3

Answer:

Basically the concept is;

Given is first 10 odd numbers.

Initialize a integer type variable with value equal to 1. say , int i=1;

Start a loop for the variable and run it twice the value of 10 = 20.

Print the value initialised in step 2+ 2. e.g; i+2;

Update the value of i as i+=2

Similar questions