tweety_bird_bunny
Journeyman
i did following coding in devc++ ver4..... it is taken from kanetkar's Let Us See book....... but it doesn't seem to work....it should recieve a float value & return its square.... no matter what i enter it gives its square as 0.000000.....
whats going wrong any suggestions.......
if it works fine on ur sys plz tel me ur compiler name....
main()
{
float square();
float a,b;
printf("plz enter the float number\n");
scanf("\n%f",&a);
b=square(a);
printf("\nsquare is %f",b);
}
float square(float x)
{
float y;
y=x*x;
return(y);
}
whats going wrong any suggestions.......
if it works fine on ur sys plz tel me ur compiler name....
main()
{
float square();
float a,b;
printf("plz enter the float number\n");
scanf("\n%f",&a);
b=square(a);
printf("\nsquare is %f",b);
}
float square(float x)
{
float y;
y=x*x;
return(y);
}