diff options
Diffstat (limited to 'ccc/float_int.cc')
-rw-r--r-- | ccc/float_int.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ccc/float_int.cc b/ccc/float_int.cc new file mode 100644 index 0000000..9d0ece4 --- /dev/null +++ b/ccc/float_int.cc @@ -0,0 +1,26 @@ +#include <iostream> + +using namespace std; + + +int main(void) +{ + int a = 1; + int b = 2; + double q = (double)a/b; + cout << q << endl; + + cout << 1 - (float)a/b << endl; + + float x = 0.1; + unsigned y = 105; + unsigned z = x*y; + cout << z << endl; + + float u = -1; + if (u) cout << "XXXXXX" << endl; + + float j = 0.0; + if (j) cout << "j" << endl; +} + |