Advertisement
idsystems

Practica 12

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