Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 need help writing a program display numbers with square root
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Miko99




PostPosted: Mon Mar 31, 2003 10:14 am   Post subject: need help writing a program display numbers with square root

Write a program that will print out the numbers 1 to 10 with their squares and cubes: Like this:
1 1 1
2 4 8
3 9 27
. . .
10 100 1000

NEED HELP WITH THIS!!! PLEASE!!!
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon Mar 31, 2003 10:34 am   Post subject: (No subject)

i dont see a problem... its just a simple for loop (you can read a tutorial on that)

code:

for i:1..10
put i, " ", i**2, " ", i**3
end for
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Dan




PostPosted: Mon Mar 31, 2003 6:13 pm   Post subject: (No subject)

note that ** makes it to the power of

ie.

1 ** 2 is 1 to the power 2
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: