Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Trabajo Practico nΒΊ 2
- // declaracion - ingreso - muestra
- // Cardozo, Duran, Berisso, Salas, Zorio, Nikcevich
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- //declaracion de variables
- int int1;
- char char1;
- bool bool1;
- double double1;
- string string1;
- //ingreso de datos
- cout << "1) Ingresar int: ";
- cin >> int1;
- cout << "2) Ingresar char: ";
- cin >> char1;
- cout << "3) Ingresar bool (0 falso, 1 verdadero): ";
- cin >> bool1;
- cout << "4) Ingresar double: ";
- cin >> double1;
- cin.ignore();
- cout << "5) Ingresar string: ";
- getline(cin,string1);
- //muestra de datos
- cout << "\nDatos ingresados:\n";
- cout << "Int: " << int1 << endl;
- cout << "Char: " << char1 << endl;
- if (bool1)
- cout << "Bool: true\n";
- else
- cout << "Bool: false\n";
- cout << "Double: " << double1 << endl;
- cout << "String: " << string1 << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement