Challenge issue


#1

Hello, I am having a problem with the Challenge at the end of the chapter. My solution was:

#include <stdio.h>

//Add your new function here
float remainingAngle(float angleA, float angleB);
{
float angleC = 180.0 - angleA - angleB;
printf(“The third angle is %.2f\n”, angleC;
}
int main (int argc, const char * argv[])
{
remainingAngle(30.0, 60.0);
}

On the line where remaining angle is declared, I get an error notification telling me "Expected identifier or ("
Could you please tell me how to correct this? Or is the problem with the way I wrote the program?


#2

[code]#include <stdio.h>

//Add your new function here
void remainingAngle(float angleA, float angleB); // this line is a prototype. There is no return so use void as the return type.

void remainingAngle(float angleA, float angleB) // define the function.
{
float angleC = 180.0 - angleA - angleB;
printf(“The third angle is %.2f\n”, angleC); // you forgot the closing )
}

int main (int argc, const char * argv[])
{
remainingAngle(30.0, 60.0);
return 0; // main wants an int to be returned to indicate it’s done.
}[/code]
mitch


#3

Thank you so much! Can’t believe it was such a simple mistake. :smiley: