Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language JSP

(Proper version (works)

Date:01/24/06
Author:Davy Boy Hayes
URL:http://www.smarterthings.co.uk
Comments:0
Info:n/a
Score: (2.96 in 25 votes)
<%  int beers = 99;
      while (beers > 0) {
        int loop = 2;
        while (loop > 0) { %>
<%=beers%> bottle<%= beers!=1 ? "s":""%> of beer<%= loop-- ==2 ? " on the wall, " : "<br>"%>
<%      } %>
Take one down pass it around,
<%= --beers>0 ? ""+beers:"no more"%> bottle<%= beers!=1 ? "s":""%> of beer on the wall.<br><br>
<%    } %>
No more bottles of beer on the wall, no more bottles of beer<br>
Go to the store, buy some more, 99 bottles of beer on the wall.<br>

Download Source | Write Comment

Alternative Versions

Comments

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: