answersLogoWhite

0


Best Answer

#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);

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

/* 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;

}

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

#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 answer is:
User Avatar

User Avatar

Wiki User

14y ago

//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;

}

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

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 ); }

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

#include<studio.h>

main()

{

int r,area;

printf("enter value of radius");

Scanf("%d",&r);

area=(22/7)*r*r;

printf("area=%d",area);

}

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

double AreaOfCircle (double Radius) return Radius * Radius * 3.14159265358979;

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a c plus plus program to find the area of circle?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a qbasic program to find area and circumerence of a circle?

Write a program that calculates the area of a triangle in QBASIC


Write a c program to find the area and perimeter of circle?

Learn c programming and geometry. It will be easy when you know both.


Write a c program to find Volume and surface area of cube?

Write a c program to compute the surface area and volume of a cube


Write a program to find the area of circle in c?

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


Write a menu driven program in java to find area of different shapes. 1. Circle 2. Triangle 3. Rectangle?

Remember that the area of a rectangle is width * height: static int getArea(Rectangle r) { return r.width * r.height; }


Write a c program to find the area of circle?

#include&lt;stdio.h&gt; #define PIE 3.142 void main() { int r,sum; printf("Enter the radius of area\n"); scanf("%d",&amp;r); sum=PIE*r*r; printf("The area of circle is:%d",sum); }


How do you find an area of a shape rectangle square and a circle in C program?

By using that one thing.


How do you write a program to find the circumfereence of the circle?

#include&lt;stdio.h&gt; void main() { int r; int pi=3.14; float cir,area; printf("/n enter the radius of the circle"); scanf("%d",&amp;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


How do you find the area of a circle inside a square?

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


Write a shell program to find the area and circumference of the circle?

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


How find the area of a square when a circle is inside?

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


Program to find area of circle using class in c?

class area{ int l,w,a; a=i*w; printf"area of rectangle is= %d",a; endl; }