Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.
/**Bismillahir Rahmanir Rahim.**/ #include <stdio.h> #include <math.h> #define PI 2*acos(0.0) int main() { int a,b; double c,d,e,f,g,h,r; scanf("%d", &b); for(a=1; a<=b; a++) { scanf("%lf", &r); c=((r+r)*(r+r))-(PI*r*r); printf("Case %d: %.2lf\n",a,c); } return 0; }
hi
ReplyDelete#include
ReplyDelete#include
#define pi 2*acos(0.0)
int main()
{
int T,i;
scanf("%d",&T);
for(i=1;i<=T;i++)
{
float area,r;
scanf("%f",&r);
area=(4*r*r)-(pi*r*r);
printf("Case %d: %.2f\n",i,area);
}
return 0;
}