1. Consider the following sequence of C/C++ statements, which are syntactically valid but have no reasonable semantic interpretation (assuming i and j have been declared as int variables): See image.

How are these situations handled when executed by your C/C++ system?

2. Consider the expression x + y/2 in the language C. How many different meanings does this expression have, depending on the types of x and y?

3. For your Java compiler/interpreter, verify whether or not the cast of the integer 65537 to a char results in an error.

4. Suggest a general strategy by which the various languages (Fortran, C, Ada, and Java) formatted I/0 conventions could become more unified. That is, can you design a generalized format expression to which a format expression in each of these languages could be mapped in a meaning preserving way? What are the difficult challenges for creating such a mapping?

5. Answer the above question again, but for unformatted I/O.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.