Swapping two numbersTwo numbers can be swapped or interchanged. It means first number will become second and second number will become first. For example There are two methods for swapping:
Swapping Using Third VariableSwap two numbers 45 and 78 using a third variable. Example: Output: Swapping Without using Third VariableSwap two numbers without using a third variable is done in two ways:
Example for (+ and -): Output: Example for (* and /): Output: Next TopicAdding Two Numbers |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India