Advertisement
idsystems

Cpp_Practica 21 - Circulo

Jan 26th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. // Program: circulo.cc
  2. // Author:  Yoan Pinzon
  3. // Date:    Agosto 30, 2006
  4.  
  5. #include <iostream>
  6. #include <iomanip>
  7.  
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12.    float radio, area, perimetro;
  13.    const float pi = 3.141592653589793;
  14.  
  15.    cout << "Area y perimetro del circulo" << endl;
  16.    cout << "============================" << endl;
  17.  
  18.    cout << "Entre el valor del radio= "; cin >> radio;
  19.  
  20.    area = pi * radio * radio;
  21.    perimetro = 2 * pi * radio;
  22.  
  23.    cout.setf(ios::fixed);
  24.    cout << setprecision(2) << endl;
  25.  
  26.    cout << "Area= " << area << endl;
  27.    cout << "Perimetro= " << perimetro << endl;
  28.  
  29.    return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement