fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. double d_15 = 15;
  6. int i_15 = 15;
  7. float f_15 = 15;
  8. double d_2 = 2;
  9. int i_2 = 2;
  10. float f_2 = 2;
  11.  
  12. cout << "Double/Double: " << d_15 / d_2 << endl;
  13. cout << "Double/Integer: " << d_15 / i_2 << endl;
  14. cout << "Double/Float: " << d_15 / f_2 << endl;
  15. cout << "Float/Double: " << f_15 / d_2 << endl;
  16. cout << "Float/Integer: " << f_15 / i_2 << endl;
  17. cout << "Float/Float: " << f_15 / f_2 << endl;
  18. cout << "Integer/Double: " << i_15 / d_2 << endl;
  19. cout << "Integer/Integer: " << i_15 / i_2 << endl;
  20. cout << "Integer/Float: " << i_15 / f_2 << endl;
  21. return 0;
  22. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
Double/Double: 7.5
Double/Integer: 7.5
Double/Float: 7.5
Float/Double: 7.5
Float/Integer: 7.5
Float/Float: 7.5
Integer/Double: 7.5
Integer/Integer: 7
Integer/Float: 7.5