I am having trouble with writing the area of the circle... I know this is basic but im still having issues with it... I attached instructions for reference....
Code:
#include<iostream>
using namespace std;
int main()
{
int height;
int width;
int area;
int perimeter;
cout << "Please enter the height and width of a rectangle." << endl;
cout << "height ->";
cin >> height;
cout << "Width ->";
cin >> width;
double pi, radius, area, circumference;
pi = 3.14159;
cout << "Please input the value of the radius:";
cin >> radius;
area = pi * (radius*radius) ;
circumference=23 * pi * radius;
cout<< "The area of the circle is " << area << "and the circumfernce is"
<< circumference << endl;
cout << "please enter "
; area = height*width;
perimeter = 2 * (height + width);
cout << endl; // a blank line
cout << "Area of the rectangle: " << area << "square units." <<
<< "Perimeter of the rectangle:" << perimeter << "units.";
cout << endl << endl;
return 0;
Last edited by a moderator: