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 1 of 2.

Urmila said:   9 years ago
Yes, Fortran(derived from "Formula Translation") 77 is a language.

Fortran 77 has only one loop construct, called the do-loop.

The do-loop is used for simple counting. expr1 specifies the initial value of var, expr2 is the terminating bound, and expr3 is the increment.

Here,

DO 52 N = 1, 10, 3.

So, 1 initial value.
10 terminating bound.
3 increment step.

So,
1 + 3 = 4.
4 + 3 = 7.
7 + 3 = 10.
(3)

Vageesha prakash said:   1 decade ago
Can someone please explain operation of fortran77?

Reetuparna Das said:   1 decade ago
What does 52 mean in between DO and N, it is definitely not a part of the instruction. The answer suggests the inclusion of 4 and 7, that too remains unexplained.

Amrata Kamat said:   1 decade ago
Can you people please explain the operation of the above problem?

Bhavana said:   1 decade ago
Number 52 is just a label in FORTRAN 77. The logic is to continue in a loop for every sum of 3 to first element i.e. 1 and end loop if number equals to 10.

Divan said:   1 decade ago
Fortan 77 is language?

Theja said:   7 years ago
Thank you for explaining the answer.

Sachin said:   7 years ago
Thanks @Urmila.

Adil said:   7 years ago
Thanks for your answer @Urmila.

Swathi said:   7 years ago
How it becomes 3 times @Urmila. Please clarify me.


Post your comments here:

Your comments will be displayed after verification.