Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

Test expression



Iterative statement



Specifer



" ; " after loop



Header file




Function_ area of a circle




// AHF C PROGRAM SOLVING

//The problem are solving here using FUNCTION

#include<stdio.h> #include<math.h> #define pf printf //function declaration float circle(float x); int main() { float a; float result; pf("Enter the radius : "); scanf("%d",&a); //function call result=circle(a); pf("\nThe area of the circle is %.2f",result); return 0; } //function definition float circle(float x) //function header //function body { return (3.1416*x*x); //return answer }
OUTPUT:


© 2018 - All rights reserved