Consider the series of alternating 1s and 0s 1 0 1 0 1 0 1 0 1 0 …… The user will enter a…

Written by

in

Consider the series of alternating 1s and 0s
1 0 1 0 1 0 1 0 1 0 ……
The user will enter a number n . And you have to output the first n numbers of this sequence (separated by spaces)
You may assume the user will enter n > 0 and an integer
Note: You may only use concepts learnt so far. You are not allowed to use more advanced concepts such as string indexing/lists etc.
Attachments:
4480667_1_Screen-Shot-2019-10-20-at-2.50.24-PM.png

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *