#include<stdio.h>
void main()
{
int r;
int pi=3.14;
float cir,area;
printf("/n enter the radius of the circle");
scanf("%d",&r);
cir=2*pi*r;
area=pi*r*r;
printf("the circumference of the circle is%d",cir);
printf('the area of the circle is %d",area);
}
/* To calculate the area and circumference of a circle, you need to know its radius. So likely the first thing to do would be to create two functions - getArea() and getCircumference() - which will each take the raduis as an argument and return their respective values:*/
#include <iostream>
#define pi 3.14159
int getArea(int radius) // Area = pi * r^2
{
return(pi * radius * radius);
}
int getCircumference(int radius) // Circumference = 2 * pi * r
{
return(2 * pi * radius);
}
// Now you can put these functions inside your main function with the proper values:
int main()
{
int radius = 5;
printf("A circle with radius %d has an area of %d and a circumference of %d\n", radius, getArea(radius), getCircumference(radius));
return 0;
}
#include<stdio.h>
#define pi 3.124
void main()
{
int r,c;
printf("enter the radius\n");
scanf("%d",&r);
c=pi*r*r;
printf("%d",c);
getch();
}
//This program will read in the radius of any circle and determine and print it area
#include <iostream>
#include <math.h>
using namespace std;
int main ()
{
int r;
double area;
// The following will allow you to keep the answer to 2places after the decimal
cout.self(ios::fixed,ios::floatfield);
cout.precision(2);
cout <<"Enter the radius of the circle ";
cin >>r;
// The area of an circle is A= pie * r squared
area= pow(r,2) * 3.14;
cout <<" The area of a circle with a radius of "<< r <<" is "<< area;
return 0;
}
You don't say how accurate you want it. Here's a version using doubles:
const double PI = 4*atan(1.0);
const double AreaOfCircle( const double radius ) {
return( PI * radius * radius ); }
#include<studio.h>
main()
{
int r,area;
printf("enter value of radius");
Scanf("%d",&r);
area=(22/7)*r*r;
printf("area=%d",area);
}
double AreaOfCircle (double Radius) return Radius * Radius * 3.14159265358979;
Write a program that calculates the area of a triangle in QBASIC
Remember that the area of a rectangle is width * height: static int getArea(Rectangle r) { return r.width * r.height; }
By using that one thing.
start read pie area circum print area print circum stop
write a vb program to find the magic square
Write a program that calculates the area of a triangle in QBASIC
Learn c programming and geometry. It will be easy when you know both.
Write a c program to compute the surface area and volume of a cube
PROGRAM TO FIND AREA & PERIMETER OF CIRCLE IN C++#include #include void main(){clrscr();double rad, area, perimeter;coutrad;area=3.14*rad*rad;perimeter=2*3.14*rad;cout
Remember that the area of a rectangle is width * height: static int getArea(Rectangle r) { return r.width * r.height; }
#include<stdio.h> #define PIE 3.142 void main() { int r,sum; printf("Enter the radius of area\n"); scanf("%d",&r); sum=PIE*r*r; printf("The area of circle is:%d",sum); }
By using that one thing.
#include<stdio.h> void main() { int r; int pi=3.14; float cir,area; printf("/n enter the radius of the circle"); scanf("%d",&r); cir=2*pi*r; area=pi*r*r; printf("the circumference of the circle is%d",cir); printf('the area of the circle is %d",area); } check related links
all you do is find the area of the circle... if you mean find the squares area, find the area of the circle, and then the square's area and subtract the squares area to the circles area
echo -n "Enter the radius of a circle : "read r# use formula to get itarea=$(echo "scale=2;3.14 * ($r * $r)" | bc)# use formula to get itd=$(echo "scale=2;2 * $r"|bc)circumference=$(echo "scale=2;3.14 * $d"| bc)echo "Area of circle is $area"echo "Circumference of circle is $circumference"# ### softspy88@gmail.com
You find the area of the whole square first. Then you find the area of the circle inside of it And then subtract the area of the circle from the area of the square and then you get the shaded area of the square
class area{ int l,w,a; a=i*w; printf"area of rectangle is= %d",a; endl; }