Share
Explore BrainMass

Java, FORTRAN, and C++

1a. What is the output from the following section of FORTRAN code?

ISUM = 0
I = 1
20 IF (I .GT. 4) GO TO 30
ISUM = ISUM + I
I = I + 1
GO TO 20
30 WRITE (*,*) ISUM

b. Write an equivalent section of Java code.

2. What is true after the following statements in a C/C++ program have been executed?

int* intPointer;
intPointer = (int*) 500;
*intPointer = 10;

Solution Preview

1a. What is the output from the following section of FORTRAN code?

ISUM = 0
I = 1
20 IF (I .GT. 4) GO TO 30
ISUM = ISUM + I
I = I + 1
GO TO 20
30 WRITE (*,*) ISUM

Answer: The output ...

Solution Summary

This response includes solutions finding the output of a FORTRAN code and its equivalent section of Java code, and explains statements of a C++ program.

$2.19