C
10 Green Bottles
by Andrew Karantzis
#include <stdio.h>
int main()
{
int numberOfBottles, i;
numberOfBottles = 10;
for ( i = numberOfBottles; i >= 1; --i)
{
if (i == 1)
{
printf ("%d, green bottle sitting on the wall!n", i);
printf ("And if one green bottle should accidentally falln");
printf ("There'll be NO more green bottles sitting on the wall!n");
}
else
{
printf ("%d, green bottle sitting on the wall!n", i);
printf ("And if one green bottle should accidentally falln");
printf ("There'll be %d green bottles sitting on the wall!n", i - 1);
}
}
};
Comments (0)
You don't have permission to comment on this page.