benchmarks.wiki / Public workspace

MMLU-Pro / 10711 / Given a two-dimensional array AMATR which contains 10 rows and 10 columns and a…

Problem

Answer published by the source. Consult the official source to check your work against its answer.

question

Given a two-dimensional array AMATR which contains 10 rows and 10 columns and a one-dimensional array called DIAG which contains 10 elements, write a program segment in FORTRAN to compute the elements of D1AG from DIAG(I) = AMATR(I, I) for I =1,2,.. .,10. Then compute the trace of AMATR, which is defined as trace(AMATR) = 10\sum_i= 1AMATR(I, I) = 10\sum_i= 1DIAG(I).

category

computer science

options

  1. DIMENSION AMATR(10,10), DIAG(10)
  2. DIMENSION AMATR (10,10), DIAG (10) TRACE = 1.0 DO 100 I = 1,10 DIAG (I) = AMATR (I, I) TRACE = TRACE + DIAG (I) 100CONTINUE STOP END
  3. DIMENSION AMATR (10,10), DIAG (10) TRACE = 0.0 DO 100 I = 1,10 DIAG (I) = AMATR (I, I) TRACE = TRACE - DIAG (I) 100CONTINUE STOP END
  4. DIMENSION AMATR (10,10), DIAG (10) TRACE = 0.0 DO 100 I = 1,10 DIAG (I) = AMATR (I, I) TRACE = TRACE * DIAG (I) 100CONTINUE STOP END
  5. DIMENSION AMATR (10,10), DIAG (10) TRACE = 0.0 DO 100 I = 1,10 DIAG (I) = AMATR (I, I) TRACE = TRACE + DIAG (I) 100CONTINUE STOP END

src

stemez-ComputerScience

Discussion

Discussion

No discussion posts on this page yet. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

Source and history

Official source

initial import