Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program: metros2todos.cc
- // Author: Yoan Pinzon
- // Date: Agosto 30, 2006
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- float x, centimetros, pulgadas, pies, yardas;
- cout << "Conversor" << endl;
- cout << "=========" << endl;
- cout << "Ingrese una distancia en metros= "; cin >> x;
- centimetros = x * 100;
- pulgadas = centimetros / 2.54;
- pies = pulgadas / 12;
- yardas = pies / 3;
- cout.setf(ios::fixed);
- cout << setprecision(2) << endl;
- cout << x << " metros equivalen a " << centimetros << " centimetros" << endl;
- cout << x << " metros equivalen a " << pulgadas << " pulgadas" << endl;
- cout << x << " metros equivalen a " << pies << " pies" << endl;
- cout << x << " metros equivalen a " << yardas << " yardas" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement