write a program to swap Two numbers without using temp variable.
Answer Posted / prudhvi
int a, b, c;
a = int.Parse(Console.ReadLine());
b = int.Parse(Console.ReadLine());
c = b;
b = a;
a = c;
Console.WriteLine("a={0},b={1}",a,b);
Console.ReadLine();
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
application attempts to perform an operation?
Function calling procedures? and their differences? Why should one go for Call by Reference?
Why is c so important?
What is function what are the types of function?
Why static variable is used in c?
Explain what is gets() function?
Is c a great language, or what?
Explain modulus operator. What are the restrictions of a modulus operator?
Why we use break in c?
Can the size of an array be declared at runtime?
What is meant by int main ()?
What is the method to save data in stack data structure type?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
Why do we need volatile in c?