You are on page 1of 1

DEF-USE (DU)

Ex1:
1. public int factorial (int n) {
2. int i; result = 1;
3. for ( i = 2; i <=n; i++) {
4. result = result * i;
5. }
6. return result;
7. }

Variable name Definition line C- Use Line P-Use Line


n 1 3
Result 2 4
Result 2 6
Result 4 4
Result 4 6
i

I started to list – you can continue in the same manner to complete

You might also like