Re: Requesting help again... as a beginner....
- Posted by DerekParnell (admin) May 25, 2009
- 974 views
Part of the problem is that we don't actually know what you are trying to do. I'm guessing now, that you want the user to enter an odd number and your program will calculate what the square of that number is, and then display the result. Is that it? If so, try this version ...
sequence range atom h, t range = {3,10000} while 1 do t = prompt_number("\nPlease enter a positive odd number greater than 2: ", range) if not and_bits(t,1) then puts(1,"\nThat is not an odd number, try again.") else h = power(t,2) printf(1, "%d squared is %d\n", {t,h}) end if end while