### Pointer Programming in C

Write a program to find the area of a Circle where area is equal to PI*Radius2. The standard value of PI is 3.144. Use pointer variable

1. #include
#include
#define PI 3.144
int *funcx(int);
int main()
{
int r, ptr;
int (*pFn)(int);
pFn=funcx;
printf("\n Enter value for radius: ");
scanf("%d",&r);
ptr=(*pFn)(r);
printf("\n Area of a circle is %f",((float)ptr));

getch();
return 0;

}

{
int area;
return (area);

}

2. #include
#include
int *find(int);
int main()
{
int r, n;
int (*w)(int);
w=find;
printf("\n Enter value for radius: ");
scanf("%d",&r);
n=(*w)(r);
printf("\n Area of a circle is %f",((float)n));
getch();
return 0;
}
{
int area;
return (area);
}

3. #define PI 3.144
int *funcx(int);
int main()
{
int r, ptr;
int (*pFn)(int);
pFn=funcx;
printf("\n Enter value for radius: ");
scanf("%d",&r);
ptr=(*pFn)(r);
printf("\n Area of a circle is %f",((float)ptr));

getch();
return 0;
}

{
int area;
return (area);

}

4. #include
float circ(float r,float pt)
{
float sum=0.0;
sum=pt * (r*r);
return sum;
}
main()
{
float r,*pt,p=3.1413;
printf("Enter the value of r in radius : ");
scanf("%f",&r);
pt=&p;
printf("\nThe area of circle :%f\n",circ(r,*pt));
}