Please help


#1

I am new to coding and am in need of assistance. I am on page 36 of Objective-c programming and am having trouble with the bottles of beer code. On the line with “printf(“Put a bottle in the recycling, %d empty bottles in the bin.\n”,” it keeps getting an error saying expected “)”. What am I doing wrong? :open_mouth:
//
// main.c
// BeerSong
//
// Created by Spencer Currie on 5/11/14.
// Copyright © 2014 Big Nerd Ranch. All rights reserved.
//

#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”,
singSongFor(oneFewer) // This funcion 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 verses, but 4 is easier to think about
singSongFor(4);
return 0;

}


#2

You entered: printf("Put a bottle in the recycling, %d empty bottles in the bin.\n"
It should be printf(“Put a bottle in the recycling, %d empty bottles in the bin.\n”);
Also don’t forget to include what the variable is
such as
printf(“Put a bottle in the recycling, %d empty bottles in the bin.\n”, emptyBottles);