Simple routine to calculate the area of a circle:
#include <iostream>
useing namespace std;
int main() {
float radius;
float area(3.14159 * radius * radius);'
cout << "Enter the radius ";
cin >> radius;
cout << "Area is: " << area << endl;
}
Now, a radius of 5 should yield a result of 78.xxxx (irr). But this routine yields 12.xxx.
Anyone have any ideas as to why this routine doesn't work?