! ! =====> Program - P42.F90 ! ! PRINT *, 'This is Program >> P42 - Nested DO loops' ! ! Two nested DO loops KS=0 LT=0 L1: DO I=1,100,2 L2: DO J=I,100 KS=KS+J END DO L2 LT=LT+I PRINT *,I,KS,LT END DO L1 STOP END OUTPUT: Program entered This is Program >> P42 - Nested DO loops 1 5050 1 3 10097 4 5 15137 9 7 20166 16 9 25180 25 11 30175 36 13 35147 49 15 40092 64 17 45006 81 19 49885 100 21 54725 121 23 59522 144 25 64272 169 27 68971 196 29 73615 225 31 78200 256 33 82722 289 35 87177 324 37 91561 361 39 95870 400 41 100100 441 43 104247 484 45 108307 529 47 112276 576 49 116150 625 51 119925 676 53 123597 729 55 127162 784 57 130616 841 59 133955 900 61 137175 961 63 140272 1024 65 143242 1089 67 146081 1156 69 148785 1225 71 151350 1296 73 153772 1369 75 156047 1444 77 158171 1521 79 160140 1600 81 161950 1681 83 163597 1764 85 165077 1849 87 166386 1936 89 167520 2025 91 168475 2116 93 169247 2209 95 169832 2304 97 170226 2401 99 170425 2500 Fortran-90 STOP
Page builder: Charles Boivin
Last modified: 11/07/95