Code: #include <stdio.h> #include <stdlib.h> main( ) { float a, b ; printf ( "\nEnter any number " ) ; scanf ( "%f", &a ) ; b = square ( a ) ; printf ( "\nSquare of %f is %f", a, b ) ; } square ( float x ) { float y ; y = x * x ; return ( y ) ; } This Program gives me error of 'conflicting type for' in code blocks build. And Whenever i run this program then it does'nt show the output in float but in integer type. Please Give the reason for this.... And also guide me how to get floating type output from this program.
Excuse me i do not know but did you miss "int" I tryed copying your code and i wouldent know but it may take a problem away? Not sure: Your Code: Code: #include <stdio.h> #include <stdlib.h> int main( ) { float a, b ; printf ( "\nEnter any number " ) ; scanf ( "%f", &a ) ; b = square ( a ) ; printf ( "\nSquare of %f is %f", a, b ) ; } square ( float x ) { float y ; y = x * x ; return ( y ) ; } i have tryed some of the skills playing around with it as well. I do not know but read the Messages and right click them and go to location. you will find the location of the problem! They are mostly tips.! PS: the code above that i copyed has an added int at location "int main()" Sorry and Thanks! Tryed to help