CSCE 150                                           Quiz 6                                                  Nov. 17, 00

Name:                                                                                      SS#:

                       

Do the following two questions:

  1. Write a Fortran 90 program to

a)      Declare a run-time matrix of M rows and N columns.

b)      Read A from the screen (row by row.)

c)      Find the transpose.

d)      Display the transpose of A.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  1. Find the output of the following segment. Here A is an integer (4 by 3) matrix.

 

R=0

DO I=1, 4

      DO K=1, 3

            A(I,K)=R

            R=R+1

      END DO

END DO

DO I=1, 3

      A(I,I)=999

END DO

DO I=1, 3

      DO K=1, I             

            A(I,K)=A(I,K)-A(K,I)

      END DO

END DO

PRINT *, ((A(I,K), K=1, 3), I=1, 3)