Please consider the following approach. As many will tell you, avoid using using namespace std;
. As great explanation for it can be found here
#include <iostream>
#include <math.h>
int main(){
double A;
double R;
char buffer[50] = {}; // Create a buffer of enough size to hold the output chars
std::cout << "Enter a number >> "; std::cin >> R;
A = 3.141519*R*R;
sprintf(buffer, "A = %.4f\n", A); // Here you define the precision you asked for
std::cout << buffer;
return 0;
}
where the output is:
Enter a number >> 56
A = 9851.8036
You can run it here