summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--4p34.cpp32
-rw-r--r--4p35.cpp22
2 files changed, 54 insertions, 0 deletions
diff --git a/4p34.cpp b/4p34.cpp
new file mode 100644
index 0000000..81bbf4c
--- /dev/null
+++ b/4p34.cpp
@@ -0,0 +1,32 @@
+#include <iostream>
+
+/*
+ *
+ * 4.34
+ *
+ *
+ */
+
+bool flag;
+short sval;
+int ival;
+long lval;
+float fval;
+char cval;
+unsigned short usval;
+unsigned int uival;
+unsigned long ulval;
+double dval;
+int main () {
+
+ if (fval) {
+ // Converted to bool
+ }
+
+ dval = fval + ival; // ival converted to float, then both converted to double
+ if(dval + ival * cval) { // cval converted to intm ival and cval converted to double
+
+ }
+
+ return 0;
+}
diff --git a/4p35.cpp b/4p35.cpp
new file mode 100644
index 0000000..d5483fd
--- /dev/null
+++ b/4p35.cpp
@@ -0,0 +1,22 @@
+#include <iostream>
+
+/*
+ *
+ * 4.35
+ *
+ *
+ */
+
+char cval;
+float fval;
+int ival;
+unsigned int ui;
+double dval;
+int main () {
+
+ cval = 'a' + 3;
+ fval = ui - ival * 1.0;
+ dval = ui * fval;
+ cval = ival + fval + dval;
+ return 0;
+}