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("Your angle in radians is %lf\n", AngleD*0.017444);
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;
}