So I am still training with C and noticed an unusal result while practicing functions.
#include <stdio.h>
#include <math.h>
void main()
{
printf("Input any number for square : ");
double X;
scanf("%f", &X);
double square(double X);
double n=square(X);
printf("The square of %f %f:", X, n);
}
double square(double X)
{
return (pow(X,2));
}
Here's the output:
Input any number for square : 21 The square of 0.000000 0.000000:
So, I am not understanding why is it returning zeros while the compilation is totally fine and the semantic looks coherent. I'll appreciate it if you don't go in depth because I think it can be explained simply (I'm still quite new ^^' )