Computer Science, asked by cruzgokul50, 9 months ago

What is the sequence of numbers for N=6?

Answers

Answered by avinashkumar288
1

Here is one possible algorithm:

If N=0, output the empty string.

If N=1, output "0 1".

If N=2, output "0 2 2 3".

If N=3, output "0 2 4 3 4 5".

If N=4, output "0 2 4 6 4 5 6 7".

If N=5, output "0 2 4 6 8 5 6 7 8 9".

Otherwise, output the empty string.

Now, this is probably not the answer they were expecting, but it's perfectly valid.

(The answer they expected was: output the first N even integers starting with zero, and then the first N integers starting with N.)

this is not the full answer but this can help you

please if you like it follow me

Answered by tanu179368
2

Answer:

hope to help you

please follow me

Attachments:
Similar questions