how to swap the variables without using temp and operators
Answer Posted / santhosh
int a, b;
a = 10;
b = 20;
a = a + b;
//a=30
b = a - b;
a = a - b;
Console.WriteLine("a={0},b={1}", a, b);
Console.ReadLine();
| Is This Answer Correct ? | 10 Yes | 2 No |
Post New Answer View All Answers
How do you define a class in oop?
What are the three parts of a simple empty class?
What is pure oop?
What is the renewal class?
What is oops concept with example?
Is data hiding and abstraction same?
What is abstract class in oop?
Why do we use polymorphism in oops?
Templates mean
explain sub-type and sub class? atleast u have differ it into 4 points?
How to hide the base class functionality in Inheritance?
Where You Can Use Interface in your Project
What makes a language oop?
What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }
Why do we need oop?