1,297 views
2 votes
2 votes

OPTIONS

A)7,19  B) 10,1 C) 10,23 D)10,32

2 Answers

1 votes
1 votes

a,b,c are global variable a=0,b=0,c=0
main() assigns value to a=3,b=5,c=7.
it calls func1()
func1()

       it create local variable a=6,b=8,
       Calls func2()

func2()

       it create local variable b=4, c = a+b
       as func2() has no local variable named a, 
       global a is available to func2().

       c=3+4 = 7

       global a = 3+11 =14

       print(c)               ----------- 7

        return to func1()
 func1():

        a=a+b+c
        a,b are local and c is global
        a=6+8+7 = 21

        print(a)     local a          ----------- 21

retun to  main()