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

Username:   Password: 
 RegisterRegister   
 loop help?
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
glitz




PostPosted: Mon Nov 27, 2006 11:02 pm   Post subject: loop help?

I'm a complete beginner to JAVA so all of this is kind of confusing to me. but in my computer science class we have to figure out a couple of things with loops.

for example, we have to print this out using nested loops:
2-----
-4----
--6---
---8--

any ideas? thanks <3
Sponsor
Sponsor
Sponsor
sponsor
TheFerret




PostPosted: Mon Nov 27, 2006 11:35 pm   Post subject: (No subject)

Java:
for (int i = 2 ; i < 10 ; i += 2) {
    System.out.println(i);
}
Display posts from previous:   
   Index -> Programming, Java -> Java 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: