J
jdcrief
Complier: Visual C++ 2005 Express Edition
The program I wrote will compile and execute, but the output is always
the same, no matter what number is entered in for the radius of the
circle. Someone please help! I am extremely new at this, as you can
probably tell. What am I missing with the code below?
#include "stdafx.h"
#include <iostream>
#include <cmath>
using std::cout;
using std::cin;
using std::endl;
int main() {
const float Pi = 3.14159;
radius = 0;
cout << "Enter the radius of a circle: ";
cin >> radius;
int area = Pi (radius * radius);
cout << endl
<< "Area of the circle is = "
<< radius
<< endl;
return 0;
}
The program I wrote will compile and execute, but the output is always
the same, no matter what number is entered in for the radius of the
circle. Someone please help! I am extremely new at this, as you can
probably tell. What am I missing with the code below?
#include "stdafx.h"
#include <iostream>
#include <cmath>
using std::cout;
using std::cin;
using std::endl;
int main() {
const float Pi = 3.14159;
radius = 0;
cout << "Enter the radius of a circle: ";
cin >> radius;
int area = Pi (radius * radius);
cout << endl
<< "Area of the circle is = "
<< radius
<< endl;
return 0;
}