The program to find the area of a circle is discussed here. The area of the circle can be found using the formula, A = πr2 where r is the radius of the circle. When the radius of the circle is known, the area of the circle can be calculated using the formula mentioned.
@@coding::1@@
@@coding::2@@
/*Here diameter is taken as the input*/n#include<stdio.h>n#define PI 3.14nint main(int a, char *b[]) //command line argumentsn{nint d; float area =0;nd= atoi(argv[1]);narea =(float) PI*(d/2)*(d/2);nprintf(“%0.2fâ€, area); //%0.2f is to print the answer with 2 values after decimal point.nreturn 0;n}n
Recommended Programs