COMP 208 Study Guide - Midterm Guide: High-Level Programming Language, Code Segment, B-Real

159 views14 pages

Document Summary

Make sure the version number is marked on your scantron sheet. The following statement will print the value of i if it is equal to 2 or 3. If the value of i is anything else, it will not print anything. In fortran all arithmetic operators at the same level of precedence are evaluated from left-to-right: true, false. What is the result of evaluating the expression 4/3 == 4/4: true, false, this is not a valid expression. Consider the following code segment. logical a1, a2 a1 = . true. a2 = a1 . and. The value assigned to a2 will be: true, false. What is the result of evaluating the expression 14 6 / 6 2: -1, 2, 11, 13, 15. What is the fortran expression 2**2**3*2 equal to: 64, 128, 512, 4096, there is an error since 2512 is too large. Suppose a program opens a file which is designated in the open statement as unit = 13.