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

Username:   Password: 
 RegisterRegister   
 hELP MAKE WRITE A PROGRAM
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Nass




PostPosted: Wed Nov 06, 2002 6:36 pm   Post subject: hELP MAKE WRITE A PROGRAM

hELP MAKE WRITE A PROGRAM


Write a program contaning an infinite loop whice output the series of integers starting at 5 and going up by 5s. revise the program to output the integer starting at 5 and decreasing by 10,s use a counter.
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Thu Nov 07, 2002 7:39 am   Post subject: loop

up by 5

code:

var n: int := 0 %decare a varible that saters at 0

loop
n += 5 % add 5 to the vlaue
put n %show the value
delay (500) %slow down the output
end loop



down by 5
code:

var n: int := 5 %decare a varible that saters at 5

loop
n -= 10 %take away 10 from vlaue
put n %show the vlaue
delay (500) %slow donw the output
end loop


hope that helps
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  [ 2 Posts ]
Jump to:   


Style:  
Search: