There is no need to swapping. Because "%" this modules operator return smaller operand when we give the first operand smaller than the 2nd operand. Like : c=a%b when a
why dont u exactly solve the problem in compiler if u follow that way it is very intresting and understandable just on paper it is very boring the students are only by hearting the algorithm for u're certificate ...... they are not getting the enjoyment of learning new knowledge
No. Not required. You're not adding or subtracting anything to the original value of g. You're just reassigning it with another value, which will simply remove the older value and store the new one.