Header Ads Widget

Responsive Advertisement

Trace table on while loop by data set part - 4

 




1.Print M3

2.While M2 <> -2

3.Read M1, M2

4.M3 = M1 + M2

5.Read M1, M2

6.Wend

7.Print M3

 

Data 6,5

Data 7,5

Data 13,15

Data -1.-2

 

Line

M1

M2

M3

M2 <> -2

Output

1

 

 

 

 

0

2

 

0

 

Yes

 

3

6

5

 

 

 

4

 

 

11

 

 

5

7

5

 

 

 

2

 

5

 

Yes

 

3

13

15

 

 

 

4

 

 

28

 

 

5

-1

-2

 

 

 

2

 

-2

 

No

 

7

 

 

 

 

28

 

 

STOP

 

 

 




Post a Comment

0 Comments