assign.cpp 462 B

123456789101112131415
  1. // assign.cpp -- type changes on assignment
  2. #include <iostream>
  3. int main()
  4. {
  5. using namespace std;
  6. cout.setf(ios_base::fixed, ios_base::floatfield);
  7. float tree = 3; // int converted to float
  8. int guess = 3.9832; // float converted to int
  9. int debt = 7.2E12; // result not defined in C++
  10. cout << "tree = " << tree << endl;
  11. cout << "guess = " << guess << endl;
  12. cout << "debt = " << debt << endl;
  13. // cin.get();
  14. return 0;
  15. }