I did the congratulatestudent exercise, and the output is correct, except that
Kate has done as much Cocoa Programming as I could fit into 5 days.
.Bo has done as much Objective-C Programming as I could fit into 2 days.
.Mike has done as much Python Programming as I could fit into 5 days.
.Liz has done as much iOS Programming as I could fit into 5 days.
.Program ended with exit code: 0
that’s what i did, u might have entered decimal, or parenthesis in the wrong places. #include <stdio.h>
void singSongFor(int numberOfBottles)
{
if (numberOfBottles == 0) {
printf(“There are simply no more bottles of beer on the wall.\n\n”);
} else {
printf("%d bottles of beer on the wall. %d bottles of beer.\n",
numberOfBottles, numberOfBottles
);
int oneFewer = numberOfBottles - 1;
printf("Take one down, pass it around, %d bottles of beer on the wall.\n\n", oneFewer);
singSongFor(oneFewer); //This function calls itself!
//print a message just before the function ends
printf("Put a bottle in the recycling, %d empty bottles in the bin.\n", numberOfBottles);
}
}
int main(int argc, const char * argv[]) {
// we could sing 99 verse, but 4 is easier to think about
singSongFor(4);
return 0;