Menu
Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
Another Easy Beginner Question
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="danielj, post: 4563834"] There is a song that goes like this: On the first day of Christmas, my true love sent to me a partridge in a pear tree. On the second day of Christmas, my true love sent to me two turtle doves and a partridge in a pear tree. ... If this goes on for the 12 days of Christmas. How many presents will your true love send you over Christmas? <strong>(Hint: You will need a loop inside another). </strong> I don't think you need a loop inside a loop.... Here is what I did: day = 0 gifts = 0 12.times do day = day + 1 gifts = gifts + day end print gifts Does anyone know how you would do it with a <em>loop inside a loop</ em>? [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
Another Easy Beginner Question
Top