# Thread: Problem with calling the function

1. ## Problem with calling the function

Code:
```#include <stdio.h>
#include <math.h>
int sum();
double arcLength();
double greatest(double t, double u, double v);
int main() {
int result1, result2;
double s;
double highestnum;
result1 = Sum();
result2 = Sum();
s = arcLength();
highestnum = greatest(double t, double u, double v); // < keeps underlining double.
printf("The highest number is %lf", highestnum);
printf("First sum = %d, Second sum = %d\n", result1, result2);
printf("Arclength = %lf meters", s);

}
int sum() {
int a, b, c;
printf("Enter a value for a: ");
scanf("%d", &a);
printf("Enter a value for b: ");
scanf("%d", &b);
printf("Enter a value for c: ");
scanf("%d", &c);
//printf("The sum of a, b, and c is: %d\n", a + b + c);
return a + b + c;
}
double arcLength() {
double r, AngleR, AngleD;
int choice;
printf("Input radius in meters for circle: ");
scanf("%lf", &r);
printf("Do you have an angle value in radians? (0 for yes or 1 for no): ");
scanf("%d", &choice);
if (choice > 0) {
printf("Enter an angle in degrees: ");
scanf("%lf", &AngleD);
printf("Input an angle in radians: ");
scanf("%lf", &AngleR);
}
else if (choice < 1) {
printf("Input an angle in radians: ");
scanf("%lf", &AngleR);
}
return r * AngleR;
}
double greatest(double t, double u, double v) {
printf("Enter 3 values: ");
scanf("%lf %lf %lf", &t, &u, &v);
if (t > u)
if (t > v)
return t;
else
return v;
else
if (u > v)
if (u > t)
return u;
else
return v;
}```

2. > highestnum = greatest(double t, double u, double v); // < keeps underlining double.
You don't include the types when you're calling a function.

Look at your usage of printf on the next line, do you see types there?

3. When I remove the double it just underlines the t u and v
Originally Posted by Salem
> highestnum = greatest(double t, double u, double v); // < keeps underlining double.
You don't include the types when you're calling a function.

Look at your usage of printf on the next line, do you see types there?

4. Hi,

Consider this code :

Code:
```#include <stdio.h>
#include <stdlib.h>

double greater(double a, double b);
double greatest(double a, double b, double c);

int main(void)
{
double t;
t = greatest(1.0,2.0,3.0);

printf("%f\n",t);
return EXIT_SUCCESS;
}

double greater(double a, double b)
{
double r;
if (a>b)
r=a;
else
r=b;

return r;
}

double greatest(double a, double b, double c)
{
double r;
double ab = greater(a,b);

r = greater(ab,c);

return r;
}```