Finding all the squares upto integer N without multiplication or exponent operators? Watch

This discussion is closed.
fishpaste
Badges: 0
Rep:
?
#1
Report Thread starter 16 years ago
#1
Yes I stole it from the computing and imperial thread.

How would you do this?
0
fishpaste
Badges: 0
Rep:
?
#2
Report Thread starter 16 years ago
#2
Something like:

c = 1
x = 1


>pointer
print x
c = c +2
x = x + c

if x = n then end else goto pointer.

Sorry for notation I don't really know any pseudo code.

I wonder if this would work.
0
fishpaste
Badges: 0
Rep:
?
#3
Report Thread starter 16 years ago
#3
edit: if n > c.
0
elpaw
Badges: 15
Rep:
?
#4
Report 16 years ago
#4
oh dear, talking to yourself again, do you need your medication?
0
fishpaste
Badges: 0
Rep:
?
#5
Report Thread starter 16 years ago
#5
(Original post by elpaw)
oh dear, talking to yourself again, do you need your medication?
No, you have the last cookie!
0
X
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Do you get study leave?

Yes- I like it (224)
61.04%
Yes- I don't like it (16)
4.36%
No- I want it (102)
27.79%
No- I don't want it (25)
6.81%

Watched Threads

View All