The float() function is declared as
float square();
Thats a no argument function .... it will only return a value ..
U've now defined the function as
float square(float x)
So even if u pass a value to the function x will be zero because u've declared the function differently ...
It should be declared as
float square(float)
here's the complete program :
Code:
#include <stdio.h>
#include <conio.h>
main()
{
float square(float);
float a;
clrscr();
printf("plz enter the number :");
scanf("%f",&a);
printf("\n\n Square is %f",square(a));
return 0;
}
float square(float x)
{
return(x*x);
}