Fortran DO Statements (how many loop times)

  • Context: Comp Sci 
  • Thread starter Thread starter rk2ray
  • Start date Start date
  • Tags Tags
    Fortran Loop
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
rk2ray
Messages
7
Reaction score
0
Hello,

Examining the following DO statements and determining how many times each loop will be executed. Assume that all loop index variables are integers.

(a) DO irange = -32768, 32767
(b) DO j = 100, 1, -10
(c) DO count = 2, 3, 4
(d) DO index = -4, -7

(e) DO i = -10, 10, 10
The loop will take 10 increments and will run 2 times.

Thanks for any help.
 
Last edited:
Physics news on Phys.org
If you don't try to evaluate at least one or two of the easy statements, you won't get any help on the harder ones.