-
8. In a computer program, the current values
of a and b are 5 and 8 respectively. It then
executes the following code 100 times.
{
Step 1: New value of a = Sum of the present
values of a and b;
Step 2: New value of a= The difference between
the present values of a and b;
Step 3: New value of b= The difference between
the present values of a and b;
} W
hat are the final values of a and b?
1) a = 5, b = 8 2) a = 8, b = 5
3) a = 5, b = 2 4) a = 5, b = 3
Somebody help please.2 Comments
Friends
Abhirup
@abhirup_bhattacharya
Media
Photos
Files
Sorry, no items found.

























The case that you have given is of swapping two numbers. The answer is option 1 a=5, b=8