Napisz program obliczający pole koła w c++



Odpowiedź :

#include <iostream>

#include <iomanip>

#include <cmath>

using namespace std;

int main()

{

double r;

cin >> r;

cout << setprecision(3) << fixed << M_PI * r * r;

return 0;

}

Myślę że pomogłem ;)

Arcis

Odpowiedź:

#include <iostream>

#include <math.h>

using namespace std;

int main() {

   int r;

   float Pk;

   cout << "Podaj dlugosc promienia: ";

   cin>>r;

   Pk=M_PI*r*r;

   cout << "Pole wynosi: "<<Pk;

   return 0;

}