Jump to content

Sum and product of an array: Difference between revisions

Line 247:
 
=={{header|Fortran}}==
In ISO Fortran 90 and later, use SUM intrinsicand PRODUCT intrinsics:
REALINTEGER, DIMENSION(1000) :: A = (/ (1.0/(i*i), i=1, 1000) /)
REALINTEGER :: RESULTSRESULT, PRESULT
RESULTSRESULT = SUM(A);
PRESULT = PRODUCT(A);
 
=={{header|Groovy}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.