Write a program to print all even and odd numbers between 1 to n.(value of ‘N’ To be accepted by the user
Answers
Answered by
1
Answer:
Small Basic Code:
textwindow.writeline("Enter a number")
n1 = textwindow.readnumber()
for a = 1 to n1
textwindow.writeline(a)
EndFor
Explanation:
for even numbers, put step 2 at the end of the "for" statement
for odd numbers, replace:
for a = 2 to n1 step 2
mark this answer as brainliest and specify the programming language next time. thanks :)
Similar questions