Output of the following code a=10 b=20 c=a, a=b , b=c print (a and b)
Answers
Answered by
38
Answer:
20&10
Explanation:
as c= garbage value
c=a means c=10
a=b means a= 20
b=c means b= 10
if we print a & b they are 20&10 respectively
Answered by
7
Output of the following, a=10 b=20 c=a, a=b , b=c print (a and b) is 10 and 10
- First, a is assigned as 10.
⇒ a = 10.
- b is assigned the value 20.
⇒ b = 20.
- c isn't assigned any value till now.
- c = a this signifies that c is assigned value 10 as a = 10.
⇒ c = 10.
- Now, b = c, earlier b was assigned value as 20 but since, b =c this means the value of b would be 10 as c = 10.
⇒ b = 10
Hence, the final values of a and b are 10 and 10.
Similar questions