real language

Bookmarking Digg Diigo DZone Earthlink Google
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language FORTRAN 77

(Arithmetic IF Version)

Author:Alex Ford
Score: (2.97 in 37 votes)
      program ninetyninebottles
      integer bottles

*     99 Bottles of Beer, as implemented in FORTRAN 77
*     Written by Alex Ford -
*     Notable feature: Arithmetic IF statement

      bottles = 99

*     Format statements
 1    format (I2, A)
 2    format (A)
 3    format (I2, A, /)
 4    format (A, /)

*     First 98 or so verses
 10   write (*,1) bottles, ' bottles of beer on the wall,'
      write (*,1) bottles, ' bottles of beer.'
      write (*,2) 'Take one down, pass it around...'
      if (bottles - 1 .gt. 1) then
         write (*,3) bottles - 1, ' bottles of beer on the wall.'
         write (*,3) bottles - 1, ' bottle of beer on the wall.'
      end if

      bottles = bottles - 1

      if (bottles - 1) 30, 20, 10

*     Last verse
 20   write (*,1) bottles, ' bottle of beer on the wall,'
      write (*,1) bottles, ' bottle of beer.'
      write (*,2) 'Take one down, pass it around...'
      write (*,4) 'No bottles of beer on the wall.'

 30   stop

Download Source | Write Comment

Alternative Versions

FORMAT edit descriptors, obfuscationRobin Haberkorn01/16/071
standard versionAnonymous04/20/051


>>  Rosanne said on 06/23/05 03:18:45

Rosanne Winner!

>>  SaraAvery said on 07/10/10 09:29:07

SaraAvery Have no a lot of cash to buy a car? You not have to worry, because it's real to receive the <a href="">credit loans</a> to resolve all the problems. Thence get a short term loan to buy everything you need.

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!




Security Code: