1
I need to make an algorithm that the user informs two values and return the biggest among them using double, but when compiling it from the error pointing something in double but do not know how to solve, someone can help me and explain how I would use correctly?
#include <stdio.h>
double maior(double *x, double *y)
{
double maior;
if (*x>*y)
{
maior=*x;
return maior;
}
else
{
maior=*y;
}
return maior;
}
int main()
{
double x,y,m;
printf("Informe dois valores com espaco entre eles:");
scanf("%f %f",&x,&y);
m=maior(&x,&y);
printf("O maior eh: %f \n",m);
return 0;
}
And the last
printf
theprintf("O maior eh: \n",m);
missing the formatter for them
– Isac