Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- float litros, galones, pulgadas, pies;
- float metros;
- int opc;
- cout << "Introduce los metros cubicos: ";
- cin >> metros;
- cout << "\nCONVERTIR A: " << endl;
- cout << "1. Litros" << endl;
- cout << "2. Galones" << endl;
- cout << "3. Pulgadas cubicas" << endl;
- cout << "4. Pies cubicos" << endl;
- cout << "5. Salir" << endl << endl;
- cout << "Opcion: ";
- cin >> opc;
- cout << endl;
- if( opc==1 ){
- //litros
- litros = metros * 1000;
- cout << "Metros = Litros" << endl;
- cout << metros << " = " << litros << endl;
- }
- else if( opc==2 ){
- //galones
- galones = metros * 264.172;
- cout << "Metros = Galones" << endl;
- cout << metros << " = " << galones << endl;
- }
- else if( opc==3 ){
- //pulgadas
- pulgadas = metros * 61023.744;
- cout << "Metros = Pulgadas" << endl;
- cout << metros << " = " << pulgadas << endl;
- }
- else if( opc==4 ){
- //pies
- pies = metros * 35.315;
- cout << "Metros = Pies" << endl;
- cout << metros << " = " << pies << endl;
- }
- else{
- cout << "Adios" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement