Language HP BASIC
(For OpenVMS)
Date: | 08/21/09 |
Author: | John Cookson |
URL: | http://www.jcsystems.ca |
Comments: | 0 |
Info: | http://h71000.www7.hp.com/commercial/basic/basic_index.html |
Score: | (2.25 in 20 votes) |
! HP Basic version of 99 bottles of beer ! Created by John Cookson FOR BOTTLE.QTY% = 99% TO 1% STEP -1% IF BOTTLE.QTY% = 1% THEN PRINT BOTTLE.QTY%;"bottle of beer on the wall";BOTTLE.QTY%;"bottle of beer" ELSE PRINT BOTTLE.QTY%;"bottles of beer on the wall,";BOTTLE.QTY%;"bottles of beer" END IF PRINT "Take one down and pass it around," IF BOTTLE.QTY% = 1% THEN PRINT " no more bottles of beer on the wall" END IF IF BOTTLE.QTY% = 2% THEN PRINT BOTTLE.QTY% - 1%; "bottle of beer on the wall" END IF IF BOTTLE.QTY% > 2% THEN PRINT BOTTLE.QTY% - 1%; "bottles of beer on the wall" END IF NEXT BOTTLE.QTY% END PROGRAM
Download Source | Write Comment
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!
Comments