Electronics and Communication Engineering - Microprocessors - Discussion

Discussion Forum : Microprocessors - Section 1 (Q.No. 31)
31.
Consider the following DO statement in Fortran 77

DO 52 N = 1, 10, 3

The number of DO loop executions in the above statement is
1
10
3
4
Answer: Option
Explanation:

Do statement is executed when N = 1, 4, 7, 10, i.e., a total of 4 times.

Discussion:
13 comments Page 2 of 2.

Nagaraj said:   7 years ago
@Urmila.

Good, thanks.

Nani said:   6 years ago
Thank you @Urmila.

Pradeep Singh said:   6 years ago
@Swathi.

It's 4 times not 3 times.

The initial number is 1 and then 3 is added to it (we get 4) , again 3 is added to 4 (we get 7), similarly the last number we get is 10 and the loop reaches its upper limit and thus ends there. Hence, the loop executes 4 times in total.


Post your comments here:

Your comments will be displayed after verification.