aljay
New Member
Posts: 1
|
Post by aljay on Mar 7, 2024 20:01:39 GMT -5
Does anyone know how to print a list of number from one number to another, for example, print every number from 10 to 20? without using a do until loop, or an for next loop or an array. Its a stupid question I know but its for a class and we arent supposed to use those. Is there a function where you can simply print from x to y where x is 10 and y is 20?
thanks
|
|
|
Post by Brandon Parker on Mar 7, 2024 21:19:58 GMT -5
Hello aljay and welcome to the forum!
Having received my computer science degree, I can assure you that there is more than one way to accomplish this task. The problem I have is that you have not posted any attempts at solving the problem and this is what your professor wants you to do...learn to solve problems using logic and programming skills.
I would suggest that you start by giving it a shot and posting your result here.
My only hint, until you exercise those brain cells, would be to possibly give it a try with a recursive function. It can be accomplished in this manner...I just created one solution in about one minute.
{:0)
Brandon Parker
|
|
|
Post by Rod on Mar 8, 2024 7:51:43 GMT -5
Perhaps the secret is to increment the number and test. Were you asked for a function? Better still post the exercise till we see what your professor was asking.
|
|