.GT. 0 .T. NAME*7 -10.7 +308 TEST0 _LESS_F123S I .FALSE. 10,512 *NEW 13.0001 NOT $20.00 ZERO 73202 .EQUAL. RESULTS
INTEGER a, b, c
a = 13.0/4
b = 1.5**2
c = 3/(1.0 - 7) * 3
d = 7/3*2
e = 2*3**2
f = b - 1.5
PRINT *,a,b,c,d,e,f
END
INTEGER P,Q
P=3
DO 10 Q=1,27,6
IF ( (2*P+Q .EQ. 9) .OR. (Q/3 .GT. P)) THEN
IF (Q .LT. P) THEN
PRINT *, 'TILL'
P = P + 3
ELSE
PRINT *,'QUIT'
P = P + 1
ENDIF
ELSEIF ( Q.EQ. 1) THEN
PRINT *, 'YOU'
IF (MOD(Q,P) .LT. 1) THEN
PRINT *, 'QUIT'
ELSE
PRINT *,'TRY'
ENDIF
ELSE
PRINT *, 'OR'
ENDIF
10 CONTINUE
PRINT *, 'NOW'
STOP
END
b) Assuming the following code:
REAL X(100)
INTEGER N
10 READ *, N
IF (N .EQ. 0) STOP
READ *,(X(I),I=1,N)
C Your code starts here
C Your code ends here
GO TO 10
END
/DATA
30
<< Data for 30 values of X inserted here >>
41
<< Data for 41 values of X inserted here >>
0
Write code that will swap the last element of array X with the
first, the second-to-last with the second, and so on.
Note that N can be even or odd. Call your FSWAP
routine, from section 4.a, to swap the elements.
c) Assuming the following code:
REAL X(100, 100)
INTEGER N
C N is the number of rows and number of columns in the matrix
10 READ *, N
IF (N .EQ. 0) STOP
READ *,((X(I,J),I=1,N),J=1,N)
C Your code starts here
C Your code ends here
GO TO 10
END
/DATA
30
<< Data for 30*30 = 900 values of X inserted here >>
41
<< Data for 41*41 = 1681 values of X inserted here >>
0
Write code that will transpose the array X. The transpose of
a matrix reflects each element of the matrix around the
diagonal.
Assume that X is a square matrix.
Again, call FSWAP to swap the elements.
For example:
Input Output 37 + 5 37 + 5 = 42 127 - 14 127 - 14 = 113 4 * 80 4 * 80 = 320Follow these specifications: